Simple framework to create HTTP modules (REST, WS or static files) in typescript
npm install http-typescript
Simple framework to create HTTP modules (REST, WS or static files) in typescript
``ts
`
// Dependencies
import {GET, HttpServer, HttpContext} from "http-typescript";
// Exemple rest module
class RestModuleTest {
@GET('/hello')
private async getHello(ctx: HttpContext) : Promise
return 'Hello !';
}
}
// Instantiate server
new HttpServer()
// To display log for debug
.debug()
// Load test module
.loadHttp(new RestModuleTest())
// start server
.listen(9495);
`
Installation avec npm
``
npm install --save http-typescript