From 995b9747e55c7ad5fd017c913bbd37281adb4b78 Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Sun, 24 Sep 2023 00:31:09 +0800 Subject: [PATCH] refactor: support for deploy to vercel refactor: remove app.ts --- index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 4188b40..6bd790d 100644 --- a/index.ts +++ b/index.ts @@ -80,7 +80,7 @@ server.get( } ); -const start = async () => { +async function startServer() { try { await server.listen({ port: 3000 }); @@ -96,4 +96,7 @@ const start = async () => { } }; -start(); +if (process.env.DEPLOYMENT_ENV !== 'vercel') startServer(); + +export default startServer; +