最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

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

IT培训 admin 6浏览 0评论

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

我有一个使用帆框架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/运行,但不会做任何事情。

回答如下:

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

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

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

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

我有一个使用帆框架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/运行,但不会做任何事情。

回答如下:

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

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

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

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论