@steedos/service-plugin-amis 2.2.10 → 2.2.11
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/package.json +2 -2
- package/package.service.js +4 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.11",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
|
-
"gitHead": "
|
|
11
|
+
"gitHead": "0eaf63bc2efddbc85f98eb5091c0545f3304ae9d"
|
|
12
12
|
}
|
package/package.service.js
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
const project = require('./package.json');
|
|
3
3
|
const packageName = project.name;
|
|
4
4
|
const packageLoader = require('@steedos/service-package-loader');
|
|
5
|
-
const _ = require(`lodash`);
|
|
6
|
-
const express = require('express');
|
|
7
|
-
const path = require('path');
|
|
8
5
|
|
|
9
6
|
/**
|
|
10
7
|
* @typedef {import('moleculer').Context} Context Moleculer's Context
|
|
@@ -21,8 +18,7 @@ module.exports = {
|
|
|
21
18
|
packageInfo: {
|
|
22
19
|
path: __dirname,
|
|
23
20
|
name: this.name,
|
|
24
|
-
}
|
|
25
|
-
initBuilderRouter: false
|
|
21
|
+
}
|
|
26
22
|
},
|
|
27
23
|
|
|
28
24
|
/**
|
|
@@ -41,37 +37,14 @@ module.exports = {
|
|
|
41
37
|
* Events
|
|
42
38
|
*/
|
|
43
39
|
events: {
|
|
44
|
-
|
|
45
|
-
this.initBuilderRouter();
|
|
46
|
-
}
|
|
40
|
+
|
|
47
41
|
},
|
|
48
42
|
|
|
49
43
|
/**
|
|
50
44
|
* Methods
|
|
51
45
|
*/
|
|
52
46
|
methods: {
|
|
53
|
-
|
|
54
|
-
handler() {
|
|
55
|
-
if (this.settings.initBuilderRouter) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
this.settings.initBuilderRouter = true;
|
|
59
|
-
try {
|
|
60
|
-
const router = express.Router();
|
|
61
|
-
let publicPath = path.join(__dirname, 'public');
|
|
62
|
-
let routerPath = "";
|
|
63
|
-
if (__meteor_runtime_config__.ROOT_URL_PATH_PREFIX) {
|
|
64
|
-
routerPath = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
|
|
65
|
-
}
|
|
66
|
-
const cacheTime = 86400000 * 1; // one day
|
|
67
|
-
router.use(routerPath, express.static(publicPath, { maxAge: cacheTime }));
|
|
68
|
-
WebApp.rawConnectHandlers.use(router);
|
|
69
|
-
} catch (error) {
|
|
70
|
-
console.error(error)
|
|
71
|
-
this.settings.initBuilderRouter = false;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
47
|
+
|
|
75
48
|
},
|
|
76
49
|
|
|
77
50
|
/**
|
|
@@ -85,7 +58,7 @@ module.exports = {
|
|
|
85
58
|
* Service started lifecycle event handler
|
|
86
59
|
*/
|
|
87
60
|
async started() {
|
|
88
|
-
|
|
61
|
+
|
|
89
62
|
},
|
|
90
63
|
|
|
91
64
|
/**
|