From afdca3af48dfbc8d8dbfdc4a4c669d7f9425086c Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 1 Nov 2021 14:57:32 +0800 Subject: [PATCH] fix: missing process.env.API_URL --- packages/create-nocobase-app/templates/AppGenerator/.umirc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/create-nocobase-app/templates/AppGenerator/.umirc.ts b/packages/create-nocobase-app/templates/AppGenerator/.umirc.ts index 42325b906..ece48c38f 100644 --- a/packages/create-nocobase-app/templates/AppGenerator/.umirc.ts +++ b/packages/create-nocobase-app/templates/AppGenerator/.umirc.ts @@ -8,13 +8,15 @@ dotenv.config({ process.env.MFSU_AD = 'none'; +const baseUrl = `http://localhost:${process.env.API_PORT || '13001'}/`; + export default defineConfig({ favicon: '/favicon.png', nodeModulesTransform: { type: 'none', }, define: { - 'process.env.API_URL': process.env.API_URL || 'http://127.0.0.1', + 'process.env.API_URL': process.env.API_URL || `${baseUrl}api/`, 'process.env.API_PORT': process.env.API_PORT || '13001', }, proxy: {