From 0756894e29eb8be5f48dfe8f72ee21162bc2c67c Mon Sep 17 00:00:00 2001 From: Alperen Elhan Date: Fri, 25 Nov 2022 23:34:16 +0300 Subject: [PATCH] fix: read port env variable after app.prepare --- src/server/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/index.ts b/src/server/index.ts index 84d1256..2a10308 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -13,7 +13,6 @@ import { updateMetadataQueue } from './queue/updateMetadata'; const dev = process.env.NODE_ENV !== 'production'; const app = next({ dev }); const handle = app.getRequestHandler(); -const port = process.env.KAIZOKU_PORT || 3000; const serverAdapter = new ExpressAdapter(); serverAdapter.setBasePath('/bull/queues'); @@ -32,6 +31,7 @@ createBullBoard({ (async () => { try { await app.prepare(); + const port = process.env.KAIZOKU_PORT || 3000; await scheduleAll(); const server = express(); server.use('/bull/queues', serverAdapter.getRouter()).all('*', (req: Request, res: Response) => {