0.5.1 ā€¢ Published 4 years ago

router-decorator-ts v0.5.1

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

router-decorator-ts

šŸšŠ my router decorator implemented in typescript

Get Started

install

npm i router-decorator-ts
# or
yarn add router-decorator-ts

use

TLDR;

https://github.com/ScarboroughCoral/router-decorator-ts/tree/master/example

Example

// HelloController.ts
import { get, controller } from '../../src/decorator'
import { Request, Response } from 'express';
@controller
class HelloController {
  @get('/hello')
  hello(req: Request, res: Response) {
    res.json({
      data: 'hello'
    })
  }
}
// index.ts
import express from "express";
import './controller/HelloController';
import { router } from '../src/decorator'


const app = express();
app.use(router);

app.listen(7001, () => {
  console.log('server is running...');
});
0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago