2
0

term.ts 496 B

1234567891011121314151617181920
  1. import { Controller, PlatformRouter } from '@tsed/common';
  2. import { Request, Response } from 'express';
  3. const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
  4. @Controller('/term')
  5. export class TermCtrl {
  6. constructor(router: PlatformRouter) {
  7. if (isOfficialMode) {
  8. router.get('/', this.getTerm);
  9. }
  10. }
  11. // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
  12. getTerm(req: Request, res: Response): string|void {
  13. res.render('term.ejs');
  14. }
  15. }