simple-tcp-server
Simple TCP server framework with koa style middlewares
Last updated 2 years ago by yujinlim .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install simple-tcp-server 
SYNC missed versions from official npm registry.

Simple TCP Build Status

A simple TCP server using koa styles and syntax with ES6 generators.

Installation

npm i --save simple-tcp-server

Example

var TCP = require('simple-tcp-server');
var app = new TCP();

app.use(function *(next) {
  this.state.user = yield db.getUser();
  yield next;
});

app.use(function *() {
  this.body = this.state.user;
});

var server = app.listen(1337);

server.on('error', function(err) {
  console.error(err);
});

Related

License

Released under the MIT License.

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (3)
Dependents (2)

Copyright 2014 - 2017 © taobao.org |