top.ts 708 B

1234567891011121314151617181920212223242526272829303132333435
  1. import {
  2. Controller, Get, Inject, View,
  3. } from '@tsed/common';
  4. import { InstallerService } from '~/services/InstallerService';
  5. const isOfficialMode = process.env.OFFICIAL_MODE === 'true';
  6. @Controller('/')
  7. export class TopCtrl {
  8. @Inject()
  9. installerService: InstallerService;
  10. @Get('/')
  11. @View('top.ejs')
  12. async getTopPage(): Promise<any> {
  13. const url = await this.installerService.installer.generateInstallUrl({
  14. // Add the scopes your app needs
  15. scopes: [
  16. 'channels:history',
  17. 'commands',
  18. 'groups:history',
  19. 'im:history',
  20. 'mpim:history',
  21. 'chat:write',
  22. 'team:read',
  23. ],
  24. });
  25. return { url, isOfficialMode };
  26. }
  27. }