1
- import fastify , { FastifyInstance } from "fastify" ;
1
+ import fastify , { FastifyInstance } from "fastify" ;
2
2
import fastifyCompress from "fastify-compress" ;
3
3
import fastifyCors from "fastify-cors" ;
4
4
import fastifyEnv from "fastify-env" ;
5
5
import fastifyFormBody from "fastify-formbody" ;
6
- import { fastifyHelmet } from "fastify-helmet" ;
6
+ import fastifyHealthCheck from "fastify-healthcheck" ;
7
+ import { fastifyHelmet } from "fastify-helmet" ;
8
+ import fastifyMetrics from "fastify-metrics" ;
7
9
import fastifyRateLimit from "fastify-rate-limit" ;
8
10
import fastifySensible from "fastify-sensible" ;
9
11
import fastifySwagger from "fastify-swagger" ;
10
- import fastifyMetrics from "fastify-metrics" ;
11
- import fastifyHealthCheck from "fastify-healthcheck" ;
12
- import { Connection } from "typeorm" ;
13
- import { config as envPluginConfig } from "./config" ;
14
- import { getDatabaseConnection } from "./services/db" ;
15
- import { logger } from "./services/logger" ;
16
- import { routesPlugin } from "./services/plugins/routes" ;
17
- import { SWAGGER_CONFIG } from "./services/swagger" ;
18
- import { fastifyLogger } from "./services/logger/fastify" ;
12
+ import { Connection } from "typeorm" ;
13
+
14
+ import { config as envPluginConfig } from "./config" ;
15
+ import { getDatabaseConnection } from "./services/db" ;
16
+ import { logger } from "./services/logger" ;
17
+ import { fastifyLogger } from "./services/logger/fastify" ;
18
+ import { routesPlugin } from "./services/plugins/routes" ;
19
+ import { SWAGGER_CONFIG } from "./services/swagger" ;
19
20
export class App {
20
21
21
22
public readonly instance : FastifyInstance ;
@@ -68,7 +69,7 @@ export class App {
68
69
) ;
69
70
try {
70
71
await this . instance . close ( ) ;
71
- } catch ( e ) {
72
+ } catch ( e ) {
72
73
logger . error ( `Error occurred during server closing because: ${ e . message } ` ) ;
73
74
}
74
75
@@ -102,7 +103,7 @@ export class App {
102
103
}
103
104
}
104
105
} ) ;
105
- if ( this . instance . config . NODE_ENV !== "test" ) {
106
+ if ( this . instance . config . NODE_ENV !== "test" ) {
106
107
this . instance . register ( fastifyMetrics , {
107
108
blacklist : '/metrics' ,
108
109
enableDefaultMetrics : true
@@ -116,4 +117,4 @@ declare module 'fastify' {
116
117
interface FastifyInstance {
117
118
db : Connection ;
118
119
}
119
- }
120
+ }
0 commit comments