@jayfong/x-server 2.35.0 → 2.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -355,10 +355,10 @@ class ApiGenerator {
|
|
|
355
355
|
},
|
|
356
356
|
paths: {},
|
|
357
357
|
servers: [{
|
|
358
|
-
url: `${process.env.APP_URL}
|
|
358
|
+
url: `${process.env.APP_URL}`.replace(/\/+$/, ''),
|
|
359
359
|
description: '生产'
|
|
360
360
|
}, {
|
|
361
|
-
url: `http://127.0.0.1:${process.env.APP_PORT}
|
|
361
|
+
url: `http://127.0.0.1:${process.env.APP_PORT}`,
|
|
362
362
|
description: '本地'
|
|
363
363
|
}]
|
|
364
364
|
};
|
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -122,6 +122,11 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
122
122
|
});
|
|
123
123
|
console.log('构建成功');
|
|
124
124
|
}).command('api', '生成 API', async () => {
|
|
125
|
+
process.env.NODE_ENV = 'production';
|
|
126
|
+
await _env_util.EnvUtil.importFile({
|
|
127
|
+
cwd: process.cwd(),
|
|
128
|
+
file: ['.env', `.env.${process.env.NODE_ENV}`]
|
|
129
|
+
});
|
|
125
130
|
await new _api_generator.ApiGenerator().start();
|
|
126
131
|
}).command('prisma', 'prisma 代理,主要为了注入环境变量', _ => _.positional('production', {
|
|
127
132
|
alias: 'p',
|
package/lib/cli/api_generator.js
CHANGED
|
@@ -350,10 +350,10 @@ export class ApiGenerator {
|
|
|
350
350
|
},
|
|
351
351
|
paths: {},
|
|
352
352
|
servers: [{
|
|
353
|
-
url: `${process.env.APP_URL}
|
|
353
|
+
url: `${process.env.APP_URL}`.replace(/\/+$/, ''),
|
|
354
354
|
description: '生产'
|
|
355
355
|
}, {
|
|
356
|
-
url: `http://127.0.0.1:${process.env.APP_PORT}
|
|
356
|
+
url: `http://127.0.0.1:${process.env.APP_PORT}`,
|
|
357
357
|
description: '本地'
|
|
358
358
|
}]
|
|
359
359
|
};
|
package/lib/cli/cli.js
CHANGED
|
@@ -119,6 +119,11 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
119
119
|
});
|
|
120
120
|
console.log('构建成功');
|
|
121
121
|
}).command('api', '生成 API', async () => {
|
|
122
|
+
process.env.NODE_ENV = 'production';
|
|
123
|
+
await EnvUtil.importFile({
|
|
124
|
+
cwd: process.cwd(),
|
|
125
|
+
file: ['.env', `.env.${process.env.NODE_ENV}`]
|
|
126
|
+
});
|
|
122
127
|
await new ApiGenerator().start();
|
|
123
128
|
}).command('prisma', 'prisma 代理,主要为了注入环境变量', _ => _.positional('production', {
|
|
124
129
|
alias: 'p',
|