【发布时间】:2015-06-04 07:20:53
【问题描述】:
我在 Azure 中有一个 node.js Web 应用程序,
该站点加载 index.html、css、图像等,但 JS 搜索功能未初始化, 我在 Chrome 中进行了 F12 检查并看到了这个错误
[domain].azurewebsites.net/data/policies.json Failed to load resource: the server responded with a status of 404 (Not Found)
在 Azure 控制台中我可以看到文件列表
> cd public
D:\home\site\wwwroot\public
> cd data
D:\home\site\wwwroot\public\data
> ls
D:\home\site\wwwroot\public\data
policies.json
根据文件夹/文件结构(一切都在/public文件夹中)我做了如下配置更改
/ = "网站/webroot/公共"
文件夹的布局是这样的
/public/index.html
/public/data
/public/js
/public/css
等
如果没有配置设置,网站不会将 /public 视为根文件夹,因此找不到 index.html 并且不会加载任何内容。
所以网站加载,这很棒, 图像和 css 加载,这很棒
但它说在数据文件夹中找不到 .json 文件? (并且使用控制台,文件肯定在那里!)
请指教。
【问题讨论】:
标签: node.js azure webserver http-status-code-404