Skip to content
Promise-based Node.js Web framework
CoffeeScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
Makefile
README.md
index.coffee
index.js
package.json
specs.coffee
specs.js

README.md

tell

Promise-based Node.js Web framework

tell = require 'tell'

...
withTransaction = (handler) ->
 (req, res, next) ->
    db.begin()
      .then(-> handler(req, res, next))
      .then(db.commit)
      .fail(db.rollback)
...

...
authenticatedOnly = (handler) ->
  (req, res, next) ->
    if not req.user?
      next()
    else
      handler(req, res, next)
...

app = tell.stack()
  .use withTransaction myHandler
  .use authenticatedOnly anotherHandler
  .catch (err, req, res, next) ->
    console.log 'error: ', err
    next(err)

app.listen(3000)
Something went wrong with that request. Please try again.