當前位置:成語大全網 - 新華字典 - sails 多維json怎麽遍歷

sails 多維json怎麽遍歷

壹、安裝時:

先裝nodejs,成功標誌 node -v

安裝sails 全局安裝 node install sails@version -g 安裝成功 sails -v

創建 項目 sails new projectname

安裝grunt : npm install grunt@version --save-dev(在項目的目錄中)

啟動sails服務:sails lift

在啟動時提示的錯誤,可以用 npm install 在當前的項目下進行安裝。

在創建api時用命令:sails generate api book(在安裝後很可能sails lift時會出現錯誤,此次的處理是npm install sails-config --save-dev

測試瀏覽:e for free as part of the restful routes.So for any custom action on a controller,a corresponding path followingthe format /:controllerName/:actionName whill respond to get requests and send the request to the controller.

Blueprit Actions

The Blueprint API creates a number of generic actions tohandleall of the standard behaviour of a restful JSON API to match the BluePrint routes.The following default controller actions,which can be overridden,are provided by the Blueprint api:

find findOne create update destory populate add remove

如何使用 pileAssets.js

tasks/register/syncAssets.js

其實如果是新項目了只需更改 tasks/importer.less為importer.sass,其它的都由Sass自動適配。

用postgres 代替LocalDB

waterline (與許多流行的數據庫壹起工作)(如:Postgresql,MongoDB,Redis.)