|
|
@ -1,12 +1,11 @@ |
|
|
|
import { join } from 'path'; |
|
|
|
|
|
|
|
import { Module, RequestMethod } from '@nestjs/common'; |
|
|
|
import { Module, RequestMethod } from '@nestjs/common'; |
|
|
|
import { APP_FILTER } from '@nestjs/core'; |
|
|
|
import { APP_FILTER } from '@nestjs/core'; |
|
|
|
import { ServeStaticModule } from '@nestjs/serve-static'; |
|
|
|
|
|
|
|
import { Connection } from './connection/connection'; |
|
|
|
import { Connection } from './connection/connection'; |
|
|
|
import { GlobalExceptionFilter } from './filters/global-exception/global-exception.filter'; |
|
|
|
import { GlobalExceptionFilter } from './filters/global-exception/global-exception.filter'; |
|
|
|
import NcPluginMgrv2 from './helpers/NcPluginMgrv2'; |
|
|
|
import NcPluginMgrv2 from './helpers/NcPluginMgrv2'; |
|
|
|
import { GlobalMiddleware } from './middlewares/global/global.middleware'; |
|
|
|
import { GlobalMiddleware } from './middlewares/global/global.middleware'; |
|
|
|
import { GuiMiddleware } from './middlewares/gui/gui.middleware'; |
|
|
|
import { GuiMiddleware } from './middlewares/gui/gui.middleware'; |
|
|
|
|
|
|
|
import { PublicMiddleware } from './middlewares/public/public.middleware' |
|
|
|
import { DatasModule } from './modules/datas/datas.module'; |
|
|
|
import { DatasModule } from './modules/datas/datas.module'; |
|
|
|
import { AuthService } from './services/auth.service'; |
|
|
|
import { AuthService } from './services/auth.service'; |
|
|
|
import { UsersModule } from './modules/users/users.module'; |
|
|
|
import { UsersModule } from './modules/users/users.module'; |
|
|
@ -17,7 +16,6 @@ import { GlobalModule } from './modules/global/global.module'; |
|
|
|
import { LocalStrategy } from './strategies/local.strategy'; |
|
|
|
import { LocalStrategy } from './strategies/local.strategy'; |
|
|
|
import { AuthTokenStrategy } from './strategies/authtoken.strategy/authtoken.strategy'; |
|
|
|
import { AuthTokenStrategy } from './strategies/authtoken.strategy/authtoken.strategy'; |
|
|
|
import { BaseViewStrategy } from './strategies/base-view.strategy/base-view.strategy'; |
|
|
|
import { BaseViewStrategy } from './strategies/base-view.strategy/base-view.strategy'; |
|
|
|
import { GoogleStrategy } from './strategies/google.strategy/google.strategy'; |
|
|
|
|
|
|
|
import NcUpgrader from './version-upgrader/NcUpgrader'; |
|
|
|
import NcUpgrader from './version-upgrader/NcUpgrader'; |
|
|
|
import { MetasModule } from './modules/metas/metas.module'; |
|
|
|
import { MetasModule } from './modules/metas/metas.module'; |
|
|
|
import type { |
|
|
|
import type { |
|
|
@ -28,9 +26,6 @@ import NocoCache from './cache/NocoCache'; |
|
|
|
|
|
|
|
|
|
|
|
@Module({ |
|
|
|
@Module({ |
|
|
|
imports: [ |
|
|
|
imports: [ |
|
|
|
ServeStaticModule.forRoot({ |
|
|
|
|
|
|
|
rootPath: join(process.cwd(), 'public'), |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
GlobalModule, |
|
|
|
GlobalModule, |
|
|
|
UsersModule, |
|
|
|
UsersModule, |
|
|
|
...(process.env['PLAYWRIGHT_TEST'] === 'true' ? [TestModule] : []), |
|
|
|
...(process.env['PLAYWRIGHT_TEST'] === 'true' ? [TestModule] : []), |
|
|
@ -60,6 +55,8 @@ export class AppModule implements OnApplicationBootstrap { |
|
|
|
consumer |
|
|
|
consumer |
|
|
|
.apply(GuiMiddleware) |
|
|
|
.apply(GuiMiddleware) |
|
|
|
.forRoutes({ path: '*', method: RequestMethod.GET }) |
|
|
|
.forRoutes({ path: '*', method: RequestMethod.GET }) |
|
|
|
|
|
|
|
.apply(PublicMiddleware) |
|
|
|
|
|
|
|
.forRoutes({ path: '*', method: RequestMethod.GET }) |
|
|
|
.apply(GlobalMiddleware) |
|
|
|
.apply(GlobalMiddleware) |
|
|
|
.forRoutes({ path: '*', method: RequestMethod.ALL }); |
|
|
|
.forRoutes({ path: '*', method: RequestMethod.ALL }); |
|
|
|
} |
|
|
|
} |
|
|
|