privacy.ts 431 B

12345678910111213141516171819
  1. import { Controller, PlatformRouter } from '@tsed/common';
  2. import { Request, Response } from 'express';
  3. const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
  4. @Controller('/privacy')
  5. export class PrivacyCtrl {
  6. constructor(router: PlatformRouter) {
  7. if (isOfficialMode) {
  8. router.get('/', this.getPrivacy);
  9. }
  10. }
  11. getPrivacy(req: Request, res: Response): string|void {
  12. res.render('privacy.ejs');
  13. }
  14. }