Edit Page
Using CoffeeScript in a Sails App
Sails supports using CoffeeScript to write your custom app code (like actions and models). You can enable this support in three steps:
- Run
npm install coffee-script
in your app folder.
- Add the following line at the top of your app's
app.js
file:require('coffee-script/register');
- Start your app with
node app.js
instead of sails lift
.
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.