Open kinkeyluja opened 3 years ago
Add router.set("view engine","ejs") before taking any requests from the router. Basically, add this line after creating router. I think this should solve your problem. Moreover, as you are inside your routes folder, you need to specify the path of the views folder as well. I think you do that by adding router.use("views", __dirname + "/../views/"). There might be a typo here, but this is the gist of it.
Error: No default engine was specified and no extension was provided. at new View (D:\Node_Passport\node_modules\express\lib\view.js:61:11) at Function.render (D:\Node_Passport\node_modules\express\lib\application.js:570:12) at ServerResponse.render (D:\Node_Passport\node_modules\express\lib\response.js:1012:7) at D:\Node_Passport\routes\index.js:4:35 at Layer.handle [as handle_request] (D:\Node_Passport\node_modules\express\lib\router\layer.js:95:5) at next (D:\Node_Passport\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (D:\Node_Passport\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (D:\Node_Passport\node_modules\express\lib\router\layer.js:95:5) at D:\Node_Passport\node_modules\express\lib\router\index.js:281:22 at Function.process_params (D:\Node_Passport\node_modules\express\lib\router\index.js:335:12) Error: No default engine was specified and no extension was provided. at new View (D:\Node_Passport\node_modules\express\lib\view.js:61:11) at Function.render (D:\Node_Passport\node_modules\express\lib\application.js:570:12) at ServerResponse.render (D:\Node_Passport\node_modules\express\lib\response.js:1012:7) at D:\Node_Passport\routes\index.js:4:35 at Layer.handle [as handle_request] (D:\Node_Passport\node_modules\express\lib\router\layer.js:95:5) at next (D:\Node_Passport\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (D:\Node_Passport\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (D:\Node_Passport\node_modules\express\lib\router\layer.js:95:5) at D:\Node_Passport\node_modules\express\lib\router\index.js:281:22 at Function.process_params (D:\Node_Passport\node_modules\express\lib\router\index.js:335:12)