top.ts 625 B

12345678910111213141516171819202122232425262728
  1. import {
  2. Controller, Get, Inject, View,
  3. } from '@tsed/common';
  4. import { InstallerService } from '~/services/InstallerService';
  5. import { requiredScopes } from '../../../slack/src/utils/required-scopes';
  6. const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
  7. @Controller('/')
  8. export class TopCtrl {
  9. @Inject()
  10. installerService: InstallerService;
  11. @Get('/')
  12. @View('top.ejs')
  13. async getTopPage(): Promise<any> {
  14. const url = await this.installerService.installer.generateInstallUrl({
  15. // Add the scopes your app needs
  16. scopes: requiredScopes,
  17. });
  18. return { url, isOfficialMode };
  19. }
  20. }