simple-tcp-server
v1.0.0
Published
Simple TCP server framework with koa style middlewares
Downloads
5
Maintainers
Readme
Simple TCP
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.