summary refs log tree commit diff
path: root/src/bundle/Server.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-26 19:50:51 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-10-26 19:50:51 +1100
commit48e114945e1b9d26edfeae8c49b19beed2dcd73b (patch)
tree8faf942e367352ade46c7ec6da9f12699cba82f2 /src/bundle/Server.ts
parentFix typo in user validation (diff)
downloadserver-48e114945e1b9d26edfeae8c49b19beed2dcd73b.tar.xz
Make /stop route not ugly as hell
Diffstat (limited to '')
-rw-r--r--src/bundle/Server.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/bundle/Server.ts b/src/bundle/Server.ts

index dd75e777..b98a3776 100644 --- a/src/bundle/Server.ts +++ b/src/bundle/Server.ts
@@ -21,13 +21,10 @@ const api = new Api.FosscordServer({ server, port, production, app }); const cdn = new CDNServer({ server, port, production, app }); const gateway = new Gateway.Server({ server, port, production }); -//this is what has been added for the /stop API route -process.on("SIGTERM", () => { - server.close(() => { - console.log("Stop API has been successfully POSTed, SIGTERM sent"); - }); +process.on("SIGTERM", async () => { + console.log("Shutting down due to SIGTERM"); + server.close(); }); -//this is what has been added for the /stop API route async function main() { await initDatabase();