privacy.ts 511 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('/privacy')
  5. export class PrivacyCtrl {
  6. constructor(router: PlatformRouter) {
  7. if (isOfficialMode) {
  8. router.get('/', this.getPrivacy);
  9. }
  10. }
  11. // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
  12. getPrivacy(req: Request, res: Response): string|void {
  13. res.render('privacy.ejs');
  14. }
  15. }