Pure nodejs framework, extreme fast and light weight which is written by typescript
npm install hinosnodejs
npm i hinos -S
`
Examples
$3
`nodejs
import { Server, Context } from 'hinos';
const yourMiddleware = async (ctx: Context, next: Function) => {
// Return error
if(ctx.query.isError) ctx.throws(401, 'error');
// Return data
ctx.data = {
msg: 'Hello world!'
}
await next();
}
Server.use(yourMiddleware);
Server.listen(1337, () => {
console.log('Server is listening at port %d', 1337);
});
`
$3
`nodejs
const hinosserver = require("hinos");
const Server = hinosserver.Server;
const yourMiddleware = async (ctx, next) => {
// Return error
if(ctx.query.isError) ctx.throws(401, 'error');
// Return data
ctx.data = {
msg: 'Hello world!'
}
await next();
}
Server.use(yourMiddleware);
Server.listen(1337, () => {
console.log('Started');
});
``