mock-config-server 4.0.2 → 4.0.3
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.
|
@@ -24,6 +24,7 @@ const contextMiddleware = (server, { database })=>{
|
|
|
24
24
|
requestId += 1;
|
|
25
25
|
request.id = requestId;
|
|
26
26
|
request.timestamp = Date.now();
|
|
27
|
+
request.graphQL = null;
|
|
27
28
|
if (request.method === 'GET' || request.method === 'POST') {
|
|
28
29
|
const graphQLInput = (0, _helpers.getGraphQLInput)(request);
|
|
29
30
|
var _graphQLInput_query;
|
|
@@ -35,10 +36,8 @@ const contextMiddleware = (server, { database })=>{
|
|
|
35
36
|
query: graphQLInput.query,
|
|
36
37
|
variables: graphQLInput.variables
|
|
37
38
|
};
|
|
38
|
-
return next();
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
request.graphQL = null;
|
|
42
41
|
request.context = context;
|
|
43
42
|
return next();
|
|
44
43
|
});
|
|
@@ -20,10 +20,8 @@ function _interop_require_default(obj) {
|
|
|
20
20
|
const startFlatMockServer = (flatMockServerConfig)=>{
|
|
21
21
|
const flatMockServer = (0, _createFlatMockServer.createFlatMockServer)(flatMockServerConfig);
|
|
22
22
|
const [option] = flatMockServerConfig;
|
|
23
|
-
const flatMockServerSettings = !('configs' in option) ? option : {
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
const { port } = flatMockServerSettings;
|
|
23
|
+
const flatMockServerSettings = !('configs' in option) ? option : {};
|
|
24
|
+
const { port = _constants.DEFAULT.PORT } = flatMockServerSettings;
|
|
27
25
|
const server = flatMockServer.listen(port, ()=>{
|
|
28
26
|
console.log(_ansicolors.default.green(`🎉 Flat Mock Server is running at http://localhost:${port}`));
|
|
29
27
|
});
|