mock-service-cli 3.1.7 → 3.2.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.
- package/lib/mockServer.js +3 -2
- package/package.json +4 -2
package/lib/mockServer.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const express = require('express'), // 引入express
|
|
2
|
+
bodyParser = require('body-parser'),
|
|
2
3
|
fs = require('fs'),
|
|
3
4
|
os = require('os'),
|
|
4
5
|
path = require('path'),
|
|
@@ -172,8 +173,8 @@ const parseMockFiles = function (specialDir = '../mock') {
|
|
|
172
173
|
}
|
|
173
174
|
};
|
|
174
175
|
|
|
175
|
-
// 允许跨域
|
|
176
|
-
app.use(
|
|
176
|
+
app.use(crossDomain()); // 允许跨域
|
|
177
|
+
app.use(bodyParser.json()); // 解析body
|
|
177
178
|
|
|
178
179
|
if (process.env.SPECIFIED_FILE) {
|
|
179
180
|
composeRouteFromJsFile(process.env.SPECIFIED_FILE);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mock-service-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "🦅 Local mock server",
|
|
5
5
|
"main": "./lib/mockServer.js",
|
|
6
6
|
"bin": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"node": ">=12"
|
|
30
30
|
},
|
|
31
31
|
"author": "chendq <deqiaochen@gmail.com>",
|
|
32
|
+
"packageManager": "yarn@1.22.19",
|
|
32
33
|
"keywords": [
|
|
33
34
|
"MIT-licensed",
|
|
34
35
|
"Mock",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"license": "MIT",
|
|
46
47
|
"homepage": "https://github.com/chandq/mock-service-cli#readme",
|
|
47
48
|
"dependencies": {
|
|
49
|
+
"body-parser": "^1.20.2",
|
|
48
50
|
"colors": "^1.4.0",
|
|
49
51
|
"deasync": "^0.1.23",
|
|
50
52
|
"express": "^4.17.1",
|
|
@@ -63,7 +65,7 @@
|
|
|
63
65
|
"eslint": "^7.0.0",
|
|
64
66
|
"eslint-config-populist": "^4.2.0",
|
|
65
67
|
"eslint-plugin-mocha": "^9.0.0",
|
|
66
|
-
"husky": "^4.
|
|
68
|
+
"husky": "^4.3.8",
|
|
67
69
|
"lint-staged": "^10.2.2",
|
|
68
70
|
"mockjs": "^1.1.0",
|
|
69
71
|
"standard-version": "^8.0.0",
|