Using .sailsrc Files
In addition to the other methods of configuring your app, as of version 0.10, you can now specify configuration for one or more apps in
.sailsrc file(s) (thanks to Dominic Tarr's excellent
rc files are most useful for configuring the command-line and/or applying configuration settings to ALL of the Sails apps you run on your computer.
When the Sails CLI runs a command, it first looks for
.sailsrc files (in either JSON or .ini format) in the current directory and in your home folder (i.e.
~/.sailsrc) (every newly generated Sails app comes with a boilerplate
.sailsrc file). Then it merges them in to its existing configuration.
Actually, Sails looks for
.sailsrcfiles in a few other places (following rc conventions). You can put a
.sailsrcfile at any of those paths. That said, stick to convention when you can- the best place to put a global
.sailsrcfile is in your home directory (i.e.
Is something missing?
If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.
- Custom Responses
- Extending Sails
- File Uploads
- Models and ORM
We wrote a book!
Get early access to the book
with promotion code: mcneildoc