npm.io
1.0.7 • Published 8 years ago

miumiu

Licence
MIT
Version
1.0.7
Deps
6
Size
30 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

Fast API server with NodeJS and Typescirpt

Struct project

--- index.ts
--- controllers
    |------ A.controller.ts
Require

Install typescirpt and setup carefull for decorator You shoud install ts-node-dev for development

Create controller
import { Controller, Get, PathParam, Post } from "miumiu";

@Controller("/hello")
export class AController {

    @Get('/')
    public async get_live(
     
    ){
        return {"OK"};
    }
    
    @Post('/')
    public async get_die(
       @Require()  @BodyParam('abc') cookies : string[]
    ){
        return {cookies};

    }
}
Create server
import { Server } from "miumiu";

new Server({port: 8080}).start();
Start
Intall ts-node-dev for development
ts-node-dev index.ts