我因使用ejs模板而发生服务器错误

时间:2019-03-28 00:32:35

标签: node.js ejs

我已经审查了此问题,但无法解决问题 Nodejs/Express: Error: Failed to lookup view "error" in views directory

我有这些服务器设置

const express = require('express');
    var jquery = require('jquery');
    var admin = require("firebase");
var bodyParser = require('body-parser')



const app = express();

 

app.use(express.static(__dirname + '/public'));

app.set('view engine', 'ejs');




app.get('/login', function (req, res) {
 
    res.render('login');
})


when I run the server this is the error I get 

>>Error: Failed to lookup view "login" in views directory 


what am I doing wrongly?

0 个答案:

没有答案