check directory

master
parent 0a6f49c301
commit 1d9aca0118

@ -6,6 +6,12 @@ const {verify, verifyAdmin} = auth;
const multer = require('multer');
let filename = __filename;
let dirname = __dirname;
console.log(filename)
console.log(dirname)
const storage = multer.diskStorage({
destination: (req, file, cb) => {
cb(null, 'public/images/');

@ -45,6 +45,12 @@ module.exports.registerUser = (request, response) => {
module.exports.loginUser = (request, response) => {
const reqBody = request.body;
let filename = __filename;
let dirname = __dirname;
console.log(filename)
console.log(dirname)
User.findOne({email : reqBody.email}).then(result => {
if(result === null) {
return response.send(false);
@ -56,7 +62,7 @@ module.exports.loginUser = (request, response) => {
const token = auth.createAccessToken(result);
return response.send({accessToken: token});
return response.send({accessToken: token, filename: filename, dirname: dirname});
}else{
return response.send(false);

Loading…
Cancel
Save