Skip to content

piotrfrankowski/decorated-uws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

decorated-uws

Small decorator based framework based on UWS.js This project is currently in alpha stages. NOT READY for production use

Idea

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.

Current stage

At this moment this library provides only very basic functionality.

Usage

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' };
  }
}

App options

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

About

Small decorator based framework based on UWS.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published