File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,23 @@ import { AbstractController } from './_common/abstracts/abstract.controller'
33import { AppService } from './app.service'
44import { Response } from 'express'
55import { Public } from './_common/decorators/public.decorator'
6+ import { ShutdownService } from '~/shutdown.service'
67
78@Public ( )
89@Controller ( )
910export class AppController extends AbstractController {
10- public constructor ( private readonly _service : AppService ) {
11+ public constructor ( private readonly _service : AppService , private readonly _shutdown : ShutdownService ) {
1112 super ( )
1213 }
1314
1415 @Get ( )
1516 public root ( @Res ( ) res : Response ) : Response {
1617 return res . json ( this . _service . getInfos ( ) )
1718 }
19+
20+ @Get ( 'shutdown' )
21+ public shutdown ( @Res ( ) res : Response ) : Response {
22+ this . _shutdown . shutdown ( )
23+ return res . json ( { } )
24+ }
1825}
Original file line number Diff line number Diff line change 1- import { Module } from '@nestjs/common'
1+ import { INestApplication , Module } from '@nestjs/common'
22import { AppController } from './app.controller'
33import { AppService } from './app.service'
44import { TicketsModule } from '~/tickets/tickets.module'
@@ -12,6 +12,7 @@ import { APP_FILTER, APP_PIPE } from '@nestjs/core'
1212import { MongooseValidationFilter } from './_common/filters/mongoose-validation.filter'
1313import { DtoValidationPipe } from './_common/pipes/dto-validation.pipe'
1414import { CoreModule } from '~/core/core.module'
15+ import { ShutdownService } from '~/shutdown.service'
1516
1617@Module ( {
1718 imports : [
@@ -53,6 +54,7 @@ import { CoreModule } from '~/core/core.module'
5354 controllers : [ AppController ] ,
5455 providers : [
5556 AppService ,
57+ ShutdownService ,
5658 {
5759 provide : APP_FILTER ,
5860 useClass : MongooseValidationFilter ,
You can’t perform that action at this time.
0 commit comments