ソースを参照

implement TermCtrl

itizawa 4 年 前
コミット
d6dc755fe1
1 ファイル変更20 行追加0 行削除
  1. 20 0
      packages/slackbot-proxy/src/controllers/term.ts

+ 20 - 0
packages/slackbot-proxy/src/controllers/term.ts

@@ -0,0 +1,20 @@
+import { Controller, PlatformRouter } from '@tsed/common';
+import { Request, Response } from 'express';
+
+const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
+
+@Controller('/term')
+export class TermCtrl {
+
+  constructor(router: PlatformRouter) {
+    if (isOfficialMode) {
+      router.get('/', this.getTerm);
+    }
+  }
+
+  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+  getTerm(req: Request, res: Response): string|void {
+    res.render('term.ejs');
+  }
+
+}