0.0.8 • Published 10 years ago

femto v0.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Femto

Femto size middleware framework, for minimal APIs.

Background

Inspired by express and Koa. In fact I needed something like Koa, without generators (to support an older node.js version).

Installation

$ npm install femto

Running unit tests, and JSLint validation

Install dev dependencies.

$ npm install

Run tests.

$ npm test

Check code quality.

$ npm run lint

Example

'use strict';

var femto = require('femto');

var app = femto();

app.use(function (next) {
  this.body = { message: 'Hello World' };
  next();
});

app.on('error', function (err, context) {
  if (context) {
    context.body = { error: true };
    context.respond();
  }
});

app.listen(process.env.PORT || 3000);

process.title = 'femto';
process.on('uncaughtException', function (err) {
  console.error('uncaughtException', err.stack);
});

License

MIT

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago