small medium large xlarge

Back to: All Forums  CoffeeScript
14 Aug 2012, 21:49
THIBAUT (2 posts)

Hi Trevor, Thank you for your excellent CoffeeScript book, I’m learning a lot ! I’m quite new to CoffeeScript (and node) and I’m having a hard time trying to solve the fact that the connect framework doesn’t allow for coffeescript compilation anymore, so the code you present page 100:

app = connect.createServer( connect.compiler( src: __dirname + '/client', enable: ['coffeescript']), connect.static(__dirname + '/client'), connect.errorHandler dumpExceptions: true, showStack: true )

doesn’t work. It’s a pity, because the example application was getting more and more interesting, and now I’m clueless about how to make the server code work. What would be a good replacement for the lines above ? Thanks in advance Christophe

01 Feb 2013, 21:48
Einar Jónsson (1 post)

You can get a compiler here:

So you basicly install it: npm install connect-compiler

Add this below your require ‘connect’ line: compiler = require(‘connect-compiler’)

And replace the connect.compiler line with: compiler({src: __dirname + ‘/client’, enabled: [‘coffee’]}),

I hope this helps.