Including and automatically compiling Sass on Express server

So I have a basic Express project set up and I'm using this github project, https://github.com/andrew/node-sass, to be able to use Sass on top of node. This is my app.js currently:

var io = require('socket.io'),
    express = require('express'),
    path = require('path'),
    routes = require('./routes'),
    jquery = require('jquery');


/**
* Create app
*/

var app = express()
  , server = require('http').createServer(app)
  , io = io.listen(server);

/**
* Configure app
*/ 

app.configure(function(){ 
    app.set('port', 8080);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'ejs');
    app.use(express.static(path.join(__dirname, 'public')));
});

What do I need to do to get Sass working and auto recompiling? I can't seem to find any useful info for Express servers specifically.

First add this require statement:

var sass = require("node-sass");

and then the following code, in your app.configure block:

...
app.use(sass.middleware({
    src: <your-sass-files-dir>,
    dest: path.join(__dirname, 'public'),
    debug: true
}));
...

But I'm sorry to say that the node-sass library is quite useless at the moment, because the @import's, in your scss files, does not work as it's supposed to... See https://github.com/andrew/node-sass/issues/27 for current status.

UPDATE 2013-10-22: Apparently the issue mentioned above seems to be fixed according to @jonathanconway in the comments below... Though there's still an unanswered comment on the issue from someone that still experiences the error at 2013-09-03

Like joakimbeng said, currently the node-sass library has an issue where the @import's are kind of broken.

However! I found a workaround, which you can see here.

What I did basically is grab the raw sass (in my case, scss), and let node-sass render the string for me. But, since it's current working directory is wherever your server.js file is located, you're going to have to put url's in your sass file, relative to your server.js. In my case, like this.