我有以下节点服务器:
dup
以下是app.js所在的文件:
推送到heroku后," /"路线被渲染。但是,在' / abstract' ' / PCA',只显示nav.ejs中的图像,找不到所有其他图像。我的css静态文件在所有文件中找到。我尝试过没有成功:
var express = require('express');
var app = express();
var path = require('path');
app.set('port', (process.env.PORT || 5000));
app.use(express.static(path.join(__dirname + '/public')));
// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.get('/', function(request, response) {
response.render('pages/index');
});
app.get('/abstract', function(request, response) {
response.render('pages/abstract');
});
app.get('/PCA', function(request, response) {
response.render('pages/PCA');
});
...
谢谢你的帮助!