Skip to content

Commit

Permalink
fix: read port env variable after app.prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Nov 25, 2022
1 parent bce6757 commit 0756894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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) => {
Expand Down

0 comments on commit 0756894

Please sign in to comment.