@roshangara/mini-webservice
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

ExpressTypeScript

Develop an ExpressJS webserver using TypeScript

create Controller ExampleController.ts

import { Request, Response } from 'express';
import { Controller, Get } from '@overnightjs/core';

@Controller('api')
export default class ExampleController {
  @Get(':msg')
  private getMessage(req: Request, res: Response) {
    res.status(200).json({
      message: req.params.msg,
    });
  }
}

create Controller ExampleController.ts

import ClusterServer from '@roshangara/mini-webservice/src/ClusterServer'
import ExampleController from './controllers/ExampleController';

let app = new ClusterServer([ExampleController]);

app.start();

Readme

Keywords

none

Package Sidebar

Install

npm i @roshangara/mini-webservice

Weekly Downloads

4

Version

1.1.3

License

MIT

Unpacked Size

4.46 kB

Total Files

8

Last publish

Collaborators

  • mroshangara