Run CoffeeScript Node.js Apps on Heroku

If you’ve written your Node.js app in coffeescript entirely and at the time of deploying on Heroku wondering how heroku would execute your coffee code, then here’s the simple process that you need to follow.

Add the coffee-script npm package into your package.json or just install it with the --save flag that’ll auto-add anyway.

$ npm install --save coffee-script

Then, instead of using the node command in your Procfile use this -

web: coffee server.coffee

I’m assuming that the server.coffee is your node app script that needs to be executed to start your web app. Hope this quick tip helps some!

Share:

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>