简体   繁体   中英

Sails.js separate views and assets in project

I have a sails webpoject and i need to divide it logically in 2 groups:

  1. site - the client side
  2. admin - the cms

This two parts should share only part of js libraries i have in asserts folder. And they should have different layouts.

What is the correct way to separate them?

Your going to find a lot of different answers here, but I might suggest just seperating the controllers and views into coorisponding subfolders.

api/controllers/cms/...*.js
views/cms/...*.ejs

api/controllers/site/...*.js
views/site/...*.ejs

Reference Create subfolders in Sails.js /api/controllers

However, there are going to be lots of opinions here, you might consider google groups for a question like this https://groups.google.com/forum/#!forum/sailsjs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM