Server

server is build upon [email protected] tries to bring simplicity in expressing your server code.

server-info

Get it: npm install server

Sample usage:

1
2
const server = require('server');
server(ctx => 'Hello world');
1
2
3
4
5
6
7
8
9
const server = require('server');
const { get, post } = require('server/router');
const { render, json } = require('server/reply');

server([
  get('/', ctx => render('index.hbs')),
  post('/', ctx => json(ctx.data)),
  get(ctx => status(404))
]);

GIF FTW:

server.gif

Suggest a module

Comments