NodeJs : TypeError: require(…) is not a function

前端 未结 7 904
旧巷少年郎
旧巷少年郎 2020-11-27 15:27

I am trying to require a file and afterwards pass it to a var. I am following this tutorial to create a authentication system. After writing the server.js file and trying to

7条回答
  •  情深已故
    2020-11-27 16:11

    Remember to export your routes.js.

    In routes.js, write your routes and all your code in this function module:

    exports = function(app, passport) {
    
    /* write here your code */ 
    
    }
    

提交回复
热议问题