sailsJs for admin前端布局

时间:2016-01-18 11:25:46

标签: javascript node.js express sails.js

我正在使用sails开发一个Web应用程序。在这个应用程序中,将有两个不同类型的用户,即管理员和客户。所以我们需要不同的布局和很多路线。我需要一些基本的了解。

  1. 是否有组路由和路由前缀的概念?就像我的前端网址是' www.abc.com /...'和管理员网址是' www.abc.com/admin /...&# 39;那么route.js的代码是什么。我知道通过对每条路线进行硬编码是可能的,但我想要这样
  2. for frontend

    '/about': {
            controller : 'aboutController',
            action     : 'index'
          },
    '/contact': {
            controller : 'contactController',
            action     : 'index'
          }
    

    for admin

      'admin':{
          '/report': {
            controller : 'ReportController',
            action     : 'loadform'
          },
         '/setting': {
            controller : 'settingController',
            action     : 'index'
          }
    
        }
    

    2.如何在控制器中维护嵌套文件夹。喜欢

    enter image description here

    1. 对这些大型应用程序的任何其他建议?

0 个答案:

没有答案