Take the 2-minute tour ×

What should I do to set coffeescript in Locomotivejs.

It seems very easy, but I couldn't figure that out.

I set options in "all.js", without luck.

I think I'm almost there or very far to get it right. :(


Any help is appreciated.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You'll want to add a server.js file and boot Locomotive with CoffeeScript support, like so:

locomotive = require('locomotive')

locomotive.boot('.', 'development', {"coffeeScript": true}, (err, server) -> 
  throw err if (err)

  server.listen(3000, 'localhost', ()-> 
    addr = this.address()
    console.log('listening on %s:%d', addr.address, addr.port);

To start the app:

$ node server

There's more info in this pull request: https://github.com/jaredhanson/locomotive/pull/44

Support for a --coffee option to the lcm command line will be added to an upcoming release.

share|improve this answer
Shouldn't it rather be server.coffee and coffee server? –  punund Feb 17 '13 at 11:29
add comment

Your Answer


