diff --git a/packages/app-server/src/index.node.ts b/packages/app-server/src/index.node.ts index ab2cd608..37b211e6 100644 --- a/packages/app-server/src/index.node.ts +++ b/packages/app-server/src/index.node.ts @@ -25,5 +25,5 @@ app serve({ fetch: app.fetch, - port: 8787, + port: config.server.port, }); diff --git a/packages/app-server/src/modules/app/config/config.ts b/packages/app-server/src/modules/app/config/config.ts index b4796f25..800fb928 100644 --- a/packages/app-server/src/modules/app/config/config.ts +++ b/packages/app-server/src/modules/app/config/config.ts @@ -10,6 +10,12 @@ export function getConfig({ env }: { env: any }) { env: 'NODE_ENV', }, server: { + port: { + doc: 'The port to listen on when using node server', + schema: z.coerce.number().min(1024).max(65535), + default: 8787, + env: 'PORT', + }, corsOrigin: { doc: 'The CORS origin the server should allow', schema: z.union([