Skip to content

Commit 3c30eff

Browse files
committed
chore: 🤖 完善 midway-koa
1 parent b35400b commit 3c30eff

File tree

6 files changed

+35
-3
lines changed

6 files changed

+35
-3
lines changed

update.list

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web-framework/python/flask/
1+
web-framework/nodejs/midway-koa
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DB_USERNAME=xxx
2+
DB_PASSWORD=xxx
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
code/build
33
code/logs
4-
code/dist
4+
code/dist
5+
.env

web-framework/nodejs/midway-koa/src/code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"scripts": {
3232
"start": "NODE_ENV=production node ./bootstrap.js",
33-
"dev": "cross-env NODE_ENV=local midway-bin dev --ts",
33+
"dev": "node start.js",
3434
"test": "midway-bin test --ts",
3535
"cov": "midway-bin cov --ts",
3636
"lint": "mwts check",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"use strict"
2+
const { CLI, checkUpdate } = require('@midwayjs/cli/dist');
3+
4+
const dotenv = require('dotenv');
5+
dotenv.config();
6+
7+
const cli = new CLI({
8+
_: [ 'dev' ],
9+
ts: true,
10+
npm: 'pnpm --registry=https://registry.npmmirror.com/'
11+
});
12+
cli
13+
.start()
14+
.then(() => {
15+
process.exit();
16+
})
17+
.catch(e => {
18+
console.log('\n\n\n');
19+
console.log(
20+
'Error! You can try adding the -V parameter for more information output.'
21+
);
22+
console.log('\n\n\n');
23+
console.error(e);
24+
process.exitCode = 1;
25+
process.exit(1);
26+
});
27+

web-framework/nodejs/midway-koa/src/s.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ services:
6363
/opt/nodejs16/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
6464
NODE_PATH: /opt/nodejs/node_modules
6565
NODE_ENV: production
66+
DB_USERNAME: ${env.DB_USERNAME}
67+
DB_PASSWORD: ${env.DB_PASSWORD}
6668
customRuntimeConfig:
6769
command:
6870
- node

0 commit comments

Comments
 (0)