我无法在本地和 heroku 服务器上为 heroku web 应用程序加载单独的 css 样式表。我最近从谷歌应用引擎迁移过来,我在那里加载样式表的方式非常好。我在这里做错了什么?任何帮助将不胜感激!!这是我的代码:
/app/server.js
var express = require("express");
var app = express();
app.use(express.logger());
var fs = require("fs");
var buf = fs.readFileSync("html/index.html");
var index = buf.toString();
app.get('/', function(request, response) {
response.send(index);
});
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});
/app/html/index.html
<!DOCTYPE html>
<html>
<head>
<title>Starters Singapore | Social Group Dating</title>
<link rel="stylesheet" type="text/css" href="../css/index.css">
</head>
<body>
<div id="testdiv">This is a test</div>
</body>
</html>
/app/css/index.css
body{
margin:0;
text-align: left;
background-color: #666666;
}
#testdiv{
width: 50%;
height: 50%;
background-color: #00a1ec;
}