소스 검색

Merge pull request #3930 from weseek/feat/6488-6490-implement-privacy-page

Feat/6488 6490 implement privacy page
Yuki Takei 4 년 전
부모
커밋
b28c5a6a2a
2개의 변경된 파일21개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      packages/slackbot-proxy/.env
  2. 20 0
      packages/slackbot-proxy/src/controllers/privacy.ts

+ 1 - 0
packages/slackbot-proxy/.env

@@ -1 +1,2 @@
 SLACK_INSTALLPROVIDER_STATE_SECRET=change-it
 SLACK_INSTALLPROVIDER_STATE_SECRET=change-it
+OFFICIAL_MODE=false

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

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