notherbase-fs 4.5.8 → 4.5.10
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/notherbase-fs.js +0 -1
- package/package.json +1 -1
- package/server/creation.js +13 -12
- package/server/spirit-world.js +1 -1
package/notherbase-fs.js
CHANGED
package/package.json
CHANGED
package/server/creation.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import express from "express";
|
|
2
2
|
import fs from 'fs';
|
|
3
|
+
import path from "path";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Creation is all the renedered pages in a base.
|
|
@@ -41,19 +42,19 @@ export default class Creation {
|
|
|
41
42
|
explore = async (req, res, next) => {
|
|
42
43
|
try {
|
|
43
44
|
req.main = `index`;
|
|
44
|
-
if (req.params.detail) req.main = req.params.detail
|
|
45
|
-
if (req.params.poi) req.main = req.params.poi
|
|
46
|
-
if (req.params.area) req.main = req.params.area
|
|
47
|
-
if (req.params.region) req.main = req.params.region
|
|
48
|
-
else req.main = "the-front
|
|
49
|
-
req.main = req.contentPath
|
|
45
|
+
if (req.params.detail) req.main = path.join(req.params.detail, req.main);
|
|
46
|
+
if (req.params.poi) req.main = path.join(req.params.poi, req.main);
|
|
47
|
+
if (req.params.area) req.main = path.join(req.params.area, req.main);
|
|
48
|
+
if (req.params.region) req.main = path.join(req.params.region, req.main);
|
|
49
|
+
else req.main = path.join("the-front", req.main);
|
|
50
|
+
req.main = path.join(req.contentPath, req.main);
|
|
50
51
|
req.preprocess = "_preprocess";
|
|
51
|
-
if (req.params.detail) req.preprocess = req.params.detail
|
|
52
|
-
if (req.params.poi) req.preprocess = req.params.poi
|
|
53
|
-
if (req.params.area) req.preprocess = req.params.area
|
|
54
|
-
if (req.params.region) req.preprocess = req.params.region
|
|
55
|
-
else req.preprocess = "the-front
|
|
56
|
-
req.preprocess = req.contentPath
|
|
52
|
+
if (req.params.detail) req.preprocess = path.join(req.params.detail, req.preprocess);
|
|
53
|
+
if (req.params.poi) req.preprocess = path.join(req.params.poi, req.preprocess);
|
|
54
|
+
if (req.params.area) req.preprocess = path.join(req.params.area, req.preprocess);
|
|
55
|
+
if (req.params.region) req.preprocess = path.join(req.params.region, req.preprocess);
|
|
56
|
+
else req.preprocess = path.join("the-front", req.preprocess);
|
|
57
|
+
req.preprocess = path.join(req.contentPath, req.preprocess);
|
|
57
58
|
req.siteTitle = `${this.bases[req.hosting].title} - ${req.params.detail || req.params.poi || req.params.area || req.params.region || "Home"}`;
|
|
58
59
|
req.toRender = "explorer";
|
|
59
60
|
|
package/server/spirit-world.js
CHANGED
|
@@ -129,7 +129,7 @@ export default class SpiritWorld {
|
|
|
129
129
|
*/
|
|
130
130
|
serve = async (req, res) => {
|
|
131
131
|
try {
|
|
132
|
-
let scriptPath =
|
|
132
|
+
let scriptPath = path.join(req.contentPath, req.body.route, `${req.body.script}.js`);
|
|
133
133
|
|
|
134
134
|
let script, result = null;
|
|
135
135
|
|