I was trying to run my app throw nodemon locally but the page keep loading and shows nothing
the list.ejs file
const express = require("express");
const bodyparser = require("body-parser");
const app = express();
app.set('view engine','ejs');
var day = "";
app.get("/",function(req,res){
var today = new Date();
if(today.getDay()===5 || today.getDay()===6){
day = "weekend";
} else {
day = "weekday";
}
app.render("list",{kindofday:day});
})
app.listen(5000,function(){
console.log("server is running on 5000");
})
error message :
Error: No default engine was specified and no extension was provided.
at new View (C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslibview.js:61:11)
at Function.render (C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslibapplication.js:570:12)
at C:UsersfaisaWeb Developmentoollist-v1app.js:13:9
at Layer.handle [as handle_request] (C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslib
outerlayer.js:95:5)
at next (C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslib
outer
oute.js:137:13)
at Route.dispatch (C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslib
outer
oute.js:112:3)
at Layer.handle [as handle_request] (C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslib
outerlayer.js:95:5)
at C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslib
outerindex.js:281:22
at Function.process_params (C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslib
outerindex.js:335:12)
at next (C:UsersfaisaWeb Developmentoollist-v1
ode_modulesexpresslib
outerindex.js:275:10)
question from:
https://stackoverflow.com/questions/65870340/my-localhost-page-shows-error-no-default-engine 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…