SailsJS无法访问位于assets / app中的index.html

时间:2017-01-11 06:22:45

标签: javascript sails.js

Sails版本:v0.12.11 节点版本:v6.6.0 NPM版本:v3.10.3 操作系统:Windows 10

您好。我刚刚创建了一个带有sails新应用程序的新风帆应用程序--no-frontend。现在我需要导入我的reactjs应用程序。我创建了assets / app / index.html(在此http://sailsjs.com/documentation/concepts/assets之后)并尝试通过http://localhost:1337/app/index.html访问它,但每次我从网络标签中收到404错误。我应该在routes.js中手动添加一些内容吗?

1 个答案:

答案 0 :(得分:1)

使用--no-frontend创建应用时,没有grunt文件和任务。所以我的资产都不会由帆管理。我手动创建了.tmp / public / app文件夹并将index.html放在那里。现在它有效。我在Manually include assets in SailsJS 0.9.7

找到了解决方案
相关问题