From d3752d227b67bf0eeccc89e9c05f033c9e2c56c9 Mon Sep 17 00:00:00 2001 From: ozaki <29860391+OzakIOne@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:46:35 +0100 Subject: [PATCH] feat(core): enable port configuration via environment variable (#9610) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Lorber --- packages/docusaurus-utils/src/constants.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-utils/src/constants.ts b/packages/docusaurus-utils/src/constants.ts index 6ecba7aea0f5..5039d6989b00 100644 --- a/packages/docusaurus-utils/src/constants.ts +++ b/packages/docusaurus-utils/src/constants.ts @@ -83,7 +83,9 @@ export const DEFAULT_I18N_DIR_NAME = 'i18n'; export const CODE_TRANSLATIONS_FILE_NAME = 'code.json'; /** Dev server opens on this port by default. */ -export const DEFAULT_PORT = 3000; +export const DEFAULT_PORT = process.env.PORT + ? parseInt(process.env.PORT, 10) + : 3000; /** Default plugin ID. */ export const DEFAULT_PLUGIN_ID = 'default';