sails.js

CRUD blueprint overriding in sails.js

*爱你&永不变心* 提交于 2019-11-26 14:39:14
According to this closed issue in sails: https://github.com/balderdashy/sails/issues/835 CRUD Blueprint Overrides "absolutely, this is coming in v0.10" I'd like to modify the blueprints in my sailsjs service to allow named roots (consuming in ember). Currently I'm having to customize every controller I create with actions that are largely duplicates of what is already in the blueprints. I suspect that I can move this code out of my controllers now and into a blueprints override area, but I'm not clear on where to put that code. Any examples or even just a pointer to the relevant code in sails

Auto reloading a Sails.js app on code changes?

こ雲淡風輕ζ 提交于 2019-11-26 11:52:21
问题 Currently is seems that for any code change in a sails.js app you have to manually stop the sails server and run sails lift again before you can see the changes. I was wondering if there is any way when running in development mode to automatically restart the sails server when it detects a code change? 回答1: You have to use a watcher like forever, nodemon, or something else... Example Install forever by running: sudo npm install -g forever Run it: forever -w start app.js To avoid infinite

How to create global variables accessible in all views using Express / Node.JS?

孤人 提交于 2019-11-26 08:44:35
问题 Ok, so I have built a blog using Jekyll and you can define variables in a file _config.yml which are accessible in all of the templates/layouts. I am currently using Node.JS / Express with EJS templates and ejs-locals (for partials/layouts. I am looking to do something similar to the global variables like site.title that are found in _config.yml if anyone is familiar with Jekyll. I have variables like the site\'s title, (rather than page title), author/company name, which stay the same on all

Sails.js populate nested associations

做~自己de王妃 提交于 2019-11-26 04:18:01
I've got myself a question regarding associations in Sails.js version 0.10-rc5. I've been building an app in which multiple models are associated to one another, and I've arrived at a point where I need to get to nest associations somehow. There's three parts: First there's something like a blog post, that's being written by a user. In the blog post I want to show the associated user's information like their username. Now, everything works fine here. Until the next step: I'm trying to show comments which are associated with the post. The comments are a separate Model, called Comment. Each of

Sails.js populate nested associations

守給你的承諾、 提交于 2019-11-26 01:15:40
问题 I\'ve got myself a question regarding associations in Sails.js version 0.10-rc5. I\'ve been building an app in which multiple models are associated to one another, and I\'ve arrived at a point where I need to get to nest associations somehow. There\'s three parts: First there\'s something like a blog post, that\'s being written by a user. In the blog post I want to show the associated user\'s information like their username. Now, everything works fine here. Until the next step: I\'m trying to