madeleine

A functional reactive server library for Node.js that allows you to have your cake, and eat it too!

madeleine

A functional reactive server library for Node.js that allows you to have your cake, and eat it too!

var madeleine = require('madeleine')
var server    = madeleine()
var app       = server(8080)
 
var hello = app.flatMap(madeleine.context('/hello/*'))
               .flatMap(madeleine.get('/:user'))
 
hello.onValue(function(request) {
  madeleine.send(request, { status: 200
                          , body: 'Hello, ' + request.params.user })
})
 
app.onError(console.log)
app.onValue(function(request) {
  madeleine.send(request, { status: 404 })
})
npm install madeleine

( ... )

( ... )

Copyright (c) 2014 Quildreen Motta

Released under the MIT licence.