Wednesday 17 May 2017

Require a single function

i am trying to export a file that has some configuration of my jwt, so i need to get those in my router

my exported function:

module.exports = {
    'secret': 'sdasda',
    'expirationTime': 60*60*24*4 
};

requiring the function

var jwtConfig = require('../config/jwt');

and i get this error: Cannot find module './config/jwt'

the config folder is 1 path above, and the jwt file is inside :S

Any tip?



via Cris dois

No comments:

Post a Comment