express-nodejs-app/src/controller/index.controller.ts
Sambo Chea 03458fe00c
Some checks failed
continuous-integration/drone/push Build is failing
Add express server from module and updated the server and config
2021-09-16 18:14:49 +07:00

18 lines
422 B
TypeScript

import { Request, Response } from "express"
import { Controller, Get } from "@cubetiq/express-server/dist/decorators"
@Controller("/hello")
export default class IndexController {
constructor() {}
@Get("")
public index(req: Request, res: Response) {
res.send(`Hello Index`)
}
@Get("/:name")
public hello(req: Request, res: Response) {
res.send(`Hello ${req.params.name}`)
}
}