Small decorator based framework based on UWS.js This project is currently in alpha stages. NOT READY for production use
Main goal of the project is to create modern wrapper on UWS.js library in order to achieve easy to use, yet fast framework. Decorators are inspired by similar projects like routing-controllers and Nest. Moreover, Fastify inspired optional optimizations are planned. UWS.js provides also support for web socket communication, custom decorators that would add support are planned.
At this moment this library provides only very basic functionality.
index.ts
import { App } from 'decorated-uws';
import { TestController } from './controller';
const app = new App({ controllers: [TestController] });
app.listen(3000);
controller.ts
import { Controller, Get } from 'decorated-uws';
@Controller('/')
class TestController {
@Get('/')
public get() {
return { hello: 'world' };
}
}
controllers: Controller[]
: array of controllers decorated with Controller
decorator
key?: string
: filename of key file to use SSL
cert?: string
: filename of cert file to use SSL
passphrase?: string
: password for SSL key
defaultBodyParser?: (data: Buffer) => any
: default request body parser, if none given, app will try to parse body as JSON