添加帆路线路径为默认网址

问题描述 投票:1回答:1

我有一个使用帆框架node服务器。

当我运行,它返回此消息:

info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.

可能的路由路径添加到默认的网址是什么?

相反http://localhost:1337的,使用http://localhost:1337/test/

我试图用npm start sails lift --appPath=/test/运行,但不会做任何事情。

javascript node.js path routes sails.js
1个回答
0
投票

如果你想Sails.js来测试你可以做一个新的视图动作(或使用view-homepage-or-redirect如果你下载的应用程序),那么你可以设置在行动中提升到一个特定的页面

if (sails.config.environment !== 'production') {
   throw {redirect:'/test'};
}

如果你最终使这个不要新动作忘了将它添加到您的routes.js

© www.soinside.com 2019 - 2024. All rights reserved.