notherbase-fs 4.0.5 → 4.0.7
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 +6 -1
- package/package.json +1 -1
- package/test-index.js +5 -0
package/notherbase-fs.js
CHANGED
|
@@ -55,7 +55,12 @@ class NotherBaseFS {
|
|
|
55
55
|
|
|
56
56
|
//provide database access and etc to use in routes
|
|
57
57
|
this.app.use((req, res, next) => {
|
|
58
|
-
|
|
58
|
+
let split = req.hostname.split(".");
|
|
59
|
+
if (split.length > 2) {
|
|
60
|
+
if (split[split.length - 2].length < 3) req.hosting = split[split.length - 3] + split[split.length - 2];
|
|
61
|
+
else req.hosting = split[split.length - 2];
|
|
62
|
+
}
|
|
63
|
+
else req.hosting = split[0];
|
|
59
64
|
req.contentPath = this.bases[req.hosting].directory;
|
|
60
65
|
next();
|
|
61
66
|
});
|
package/package.json
CHANGED
package/test-index.js
CHANGED
|
@@ -7,6 +7,11 @@ const notherBaseFS = new NotherBaseFS({}, {
|
|
|
7
7
|
directory: fileURLToPath(new URL('./test', import.meta.url)),
|
|
8
8
|
icon: '/public/drum.png'
|
|
9
9
|
},
|
|
10
|
+
notherbaselo: {
|
|
11
|
+
title: "NotherBase",
|
|
12
|
+
directory: fileURLToPath(new URL('./test', import.meta.url)),
|
|
13
|
+
icon: '/public/drum.png'
|
|
14
|
+
},
|
|
10
15
|
test: {
|
|
11
16
|
title: "TestBase",
|
|
12
17
|
directory: fileURLToPath(new URL('./test2', import.meta.url)),
|