4.0.0 • Published 6 years ago
syrah v4.0.0
Syrah
Fast, minimalist TCP middleware framework for node
Basic usage
Echo server
const Syrah = require('syrah');
const app = new Syrah();
app.use((ctx, next) => {
console.log(ctx.rawBuffer);
next();
});
app.use((ctx) => {
ctx.body = ctx.rawBuffer
});
app.listen(9991);
Time server
const Syrah = require('syrah');
const app = new Syrah();
app.use(ctx => {
ctx.body = new Date().toUTCString();
ctx.close('\n');
});
app.listen(9991);