This is one of my first stack overflow questions, so I'll try to do my best in asking my question..
I'm following this tutorial exactly ( http://scotch.io/tutorials/javascript/easy-node-authentication-setup-and-local ) and after the third part ( "Application Setup server.js) when I try to run the server I get "TypeError: object is not a function" for the line:
require('./app/routes.js')(app, pspt); // load our routes and pass in our app
I found other people having similar problems that were caused by naming conflicts with local variables. I tried renaming passport to pspt but it seems like the error was found at the start of the second parenthesis, before my variables. Should I rename the 'app/routes' folder?
Thanks!
EDIT: Yeah, the tutorial made it seem like it should work right after the third part. I moved onto the fourth part and it worked fine. Thanks again.
Make sure your ./app/routes.js module returns a function. It should be something like:
module.exports = function(app, passport) {
//...
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With