wrapper.express
Monadic wrapper over Express web framework.
Last updated 5 years ago by killdream .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install wrapper.express 
SYNC missed versions from official npm registry.

wrapper.express

Build Status NPM version Dependencies Status experimental

Monadic wrapper over Express web framework.

Example

var Future  = require('data.future')
var Express = require('wrapper.express')(require('express'))

var routes = [
  Express.get('/:name', function(req) {
    return new Future(function(reject, resolve) {
      resolve(Express.send('Hello, ' + req.params.name))
    })
  })
]

var app = Express.create(routes)

Express.listen(8080, app).fork(
  function (error){ throw error }
, function (addr) { console.log('Running on http://localhost:' + addr.port) }
)

Or with Sweet.js macros:

var Express = require('wrapper.express')(require('express'));

var routes = $routes(Express) {
  get('/:name'): {params:{ name }} => $do {
    html <- Future.of('Hello, ' + name)
    return Express.send(html)
  }
}

Check out the examples/ folder for more examples.

Installing

The easiest way is to grab it from NPM. If you're running in a Browser environment, you can use Browserify

$ npm install wrapper.express

Documentation

Check out the Wiki for detailed information about the library. There's also plenty of Examples in the examples/ folder.

You can read the API documentation online or build it yourself:

$ git clone git://github.com/folktale/wrapper.express.git
$ cd wrapper.express
$ npm install
$ make documentation

Then open the file docs/index.html in your browser.

Platform

This library requires express@4.x and node@0.10+.

Licence

Copyright (c) 2014 Quildreen Motta.

Released under the MIT licence.

Current Tags

  • 0.3.0                                ...           latest (5 years ago)

6 Versions

  • 0.3.0                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 6
Dependencies (6)
Dev Dependencies (19)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |