We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db9b935 commit 1e98f1aCopy full SHA for 1e98f1a
1 file changed
src/server.ts
@@ -1,5 +1,4 @@
1
// Require library to exit fastify process, gracefully (if possible)
2
-import closeWithGrace from 'close-with-grace'
3
import * as dotenv from 'dotenv'
4
// Require the framework
5
import Fastify from 'fastify'
@@ -19,20 +18,6 @@ const app = Fastify({
19
18
// Register your application as a normal plugin.
20
void app.register(import('./app'))
21
22
-// Delay is the number of milliseconds for the graceful close to finish
23
-const closeListeners = closeWithGrace({ delay: 500 }, async (opts: any) => {
24
- if (opts.err) {
25
- app.log.error(opts.err)
26
- }
27
-
28
- await app.close()
29
-})
30
31
-app.addHook('onClose', async (_instance, done) => {
32
- closeListeners.uninstall()
33
- done()
34
35
36
// Start listening.
37
void app.listen({
38
port: Number(process.env.PORT ?? 3000),
0 commit comments