【发布时间】:2017-03-10 23:19:16
【问题描述】:
错误代码 http://localhost:3000/public/resource/calendar.png 加载资源失败:服务器响应状态为404(未找到)
我想要网络服务。我不知道为什么会出现这个错误。
它在本地文件中运行良好,但是从nodejs开始这个错误
这是我的来源
app.js
var express = require('express'),
app = express(),
server = require('http').createServer(app),
io = require('socket.io').listen(server);
server.listen(3000);
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
index.html(源代码太长)
这是错误代码
text-align: center;
background: url('./public/resource/calendar.png');
background-size: contain;
且 png 文件路径为 D:\Hackathon\public\resource
和app.js,索引路径是D:\Hackathon
请帮帮我
【问题讨论】: