14 Aug 2012, 21:49

THIBAUT (1 post)

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: https://github.com/dsc/connect-compiler

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.

13 Jul 2013, 15:23

David Silver (1 post)

Works for me!

  You must be logged in to comment