From 5131155572e9b5adb4801c9af194c50a16e74fb8 Mon Sep 17 00:00:00 2001 From: Denis Anikin Date: Tue, 17 Oct 2023 04:42:33 +0300 Subject: [PATCH] 0.0.0.0 listen --- back/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/back/index.ts b/back/index.ts index e02cd26..0724ed9 100755 --- a/back/index.ts +++ b/back/index.ts @@ -20,13 +20,13 @@ myFastifyApp.get("/api/githubrepos/", fetchGitlabRepos); myFastifyApp.get("/rpc/redirect/", redirectSomewhere); // and other tech things -myFastifyApp.listen( - { port: config.APP_PORT, address: "0.0.0.0" } as any, - (err, address) => { - if (err) throw err; - myFastifyApp.log.info(`server listening on ${address}`); - } -); +myFastifyApp + .listen({ port: config.APP_PORT, host: "0.0.0.0" } as any) + .then((address) => console.log(`server listening on ${address}`)) + .catch((err) => { + console.log("Error starting server:", err); + process.exit(1); + }); process.on("SIGINT", closeGracefully); process.on("SIGTERM", closeGracefully);