问题
When I have one views folder specified it will serve files, but when I specify a second alongside it does not work. I have tried numerous things, to no avail. Here is my code:
app.use(express.static('views'));
//app.set('views', [__dirname + '/views', __dirname + '/views/views2']);
app.use("/views", express.static(__dirname + "/views"));
app.use("/views2", express.static(__dirname + "/views2"));
The app.set doesn't work at all and so I commented it out here, and the last two lines are not working either.
来源:https://stackoverflow.com/questions/64625507/how-to-set-multiple-views-folder-in-express-js-app