Sails 版本:v0.12.11 节点版本:v6.6.0 NPM版本:v3.10.3 操作系统:Windows 10
你好。我刚刚使用 sails new app --no-frontend 创建了一个新的 sails 应用程序。现在我需要导入我的reactjs 应用程序。我创建了 asset/app/index.html (遵循此 http://sailsjs.com/documentation/concepts/assets )并尝试通过 http://localhost:1337/app/index.html 访问它,但每次我从网络选项卡中收到 404 错误。我应该在routes.js中手动添加一些东西吗?
最佳答案
当使用 --no-frontend 创建应用程序时,没有 grunt 文件和任务。所以我的 Assets 都不会由 sails 管理。我手动创建了 .tmp/public/app 文件夹并将我的 index.html 放在那里。现在可以了。我在这里找到了解决方案 Manually include assets in SailsJS 0.9.7
关于javascript - SailsJS 无法访问位于 asset/app 中的 index.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41584010/