@midwayjs/web 3.1.3 → 3.1.4
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/dist/utils.js +10 -10
- package/package.json +2 -2
package/dist/utils.js
CHANGED
|
@@ -67,6 +67,16 @@ const getCurrentDateString = (timestamp = Date.now()) => {
|
|
|
67
67
|
};
|
|
68
68
|
exports.getCurrentDateString = getCurrentDateString;
|
|
69
69
|
async function initializeAgentApplicationContext(agent) {
|
|
70
|
+
const applicationContext = (0, core_1.getCurrentApplicationContext)();
|
|
71
|
+
const agentFramework = new web_1.MidwayWebFramework(applicationContext);
|
|
72
|
+
agentFramework['logger'] = agent.logger;
|
|
73
|
+
agentFramework['appLogger'] = agent.coreLogger;
|
|
74
|
+
agentFramework.app = agent;
|
|
75
|
+
agentFramework.configService = applicationContext.get(core_1.MidwayConfigService);
|
|
76
|
+
agentFramework.environmentService = applicationContext.get(core_1.MidwayEnvironmentService);
|
|
77
|
+
agentFramework.loggerService = applicationContext.get(core_1.MidwayLoggerService);
|
|
78
|
+
agentFramework.informationService = applicationContext.get(core_1.MidwayInformationService);
|
|
79
|
+
agentFramework.overwriteApplication('agent');
|
|
70
80
|
if (process.env['EGG_CLUSTER_MODE'] === 'true') {
|
|
71
81
|
// init aop support
|
|
72
82
|
const aspectService = (0, core_1.getCurrentApplicationContext)().get(core_1.MidwayAspectService);
|
|
@@ -108,16 +118,6 @@ async function initializeAgentApplicationContext(agent) {
|
|
|
108
118
|
else {
|
|
109
119
|
debug('[egg]: "initializeAgentApplicationContext" ignore re-init in single process');
|
|
110
120
|
}
|
|
111
|
-
const applicationContext = (0, core_1.getCurrentApplicationContext)();
|
|
112
|
-
const agentFramework = new web_1.MidwayWebFramework(applicationContext);
|
|
113
|
-
agentFramework['logger'] = agent.logger;
|
|
114
|
-
agentFramework['appLogger'] = agent.coreLogger;
|
|
115
|
-
agentFramework.app = agent;
|
|
116
|
-
agentFramework.configService = applicationContext.get(core_1.MidwayConfigService);
|
|
117
|
-
agentFramework.environmentService = applicationContext.get(core_1.MidwayEnvironmentService);
|
|
118
|
-
agentFramework.loggerService = applicationContext.get(core_1.MidwayLoggerService);
|
|
119
|
-
agentFramework.informationService = applicationContext.get(core_1.MidwayInformationService);
|
|
120
|
-
agentFramework.overwriteApplication('agent');
|
|
121
121
|
return applicationContext;
|
|
122
122
|
}
|
|
123
123
|
exports.initializeAgentApplicationContext = initializeAgentApplicationContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/web",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "Midway Web Framework for Egg.js",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=12"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "ca98130962ab629a65912870f82f64bd0e44566d"
|
|
64
64
|
}
|