@sap-ux/preview-middleware 0.13.40 → 0.13.41
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/base/flp.js +9 -6
- package/package.json +2 -2
package/dist/base/flp.js
CHANGED
|
@@ -256,15 +256,18 @@ class FlpSandbox {
|
|
|
256
256
|
// register static client sources
|
|
257
257
|
this.router.use(PREVIEW_URL.client.url, (0, express_1.static)(PREVIEW_URL.client.local));
|
|
258
258
|
// add route for the sandbox.html
|
|
259
|
-
this.router.get(this.config.path, ((_req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
//
|
|
259
|
+
this.router.get(this.config.path, ((_req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
260
|
+
// inform the user if a html file exists on the filesystem
|
|
261
261
|
const file = yield this.project.byPath(this.config.path);
|
|
262
262
|
if (file) {
|
|
263
|
-
this.logger.
|
|
263
|
+
this.logger.info(`HTML file returned at ${this.config.path} is loaded from the file system.`);
|
|
264
|
+
next();
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
const template = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../templates/flp/sandbox.html'), 'utf-8');
|
|
268
|
+
const html = (0, ejs_1.render)(template, this.templateConfig);
|
|
269
|
+
this.sendResponse(res, 'text/html', 200, html);
|
|
264
270
|
}
|
|
265
|
-
const template = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../templates/flp/sandbox.html'), 'utf-8');
|
|
266
|
-
const html = (0, ejs_1.render)(template, this.templateConfig);
|
|
267
|
-
this.sendResponse(res, 'text/html', 200, html);
|
|
268
271
|
})));
|
|
269
272
|
}
|
|
270
273
|
/**
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.13.
|
|
12
|
+
"version": "0.13.41",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"mem-fs": "2.1.0",
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
28
|
"@sap-ux/logger": "0.5.1",
|
|
29
|
+
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.20",
|
|
29
30
|
"@sap-ux/btp-utils": "0.14.4",
|
|
30
31
|
"@sap-ux/adp-tooling": "0.10.6",
|
|
31
|
-
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.20",
|
|
32
32
|
"@sap-ux/project-access": "1.20.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|