/miumiu

Fast API server with Typescript

Primary LanguageTypeScriptMIT LicenseMIT

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