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 CHANGED
@@ -75,7 +75,6 @@ class NotherBaseFS {
75
75
  else req.hosting = split[split.length - 2];
76
76
  }
77
77
  else req.hosting = split[0];
78
- console.log(split, req.hosting, this.bases);
79
78
 
80
79
  req.contentPath = this.bases[req.hosting].directory;
81
80
  next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "4.5.8",
3
+ "version": "4.5.10",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
@@ -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 + "\\" + req.main;
45
- if (req.params.poi) req.main = req.params.poi + "\\" + req.main;
46
- if (req.params.area) req.main = req.params.area + "\\" + req.main;
47
- if (req.params.region) req.main = req.params.region + "\\" + req.main;
48
- else req.main = "the-front\\" + req.main;
49
- req.main = req.contentPath + "\\" + req.main;
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 + "\\" + req.preprocess;
52
- if (req.params.poi) req.preprocess = req.params.poi + "\\" + req.preprocess;
53
- if (req.params.area) req.preprocess = req.params.area + "\\" + req.preprocess;
54
- if (req.params.region) req.preprocess = req.params.region + "\\" + req.preprocess;
55
- else req.preprocess = "the-front\\" + req.preprocess;
56
- req.preprocess = req.contentPath + "\\" + req.preprocess;
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
 
@@ -129,7 +129,7 @@ export default class SpiritWorld {
129
129
  */
130
130
  serve = async (req, res) => {
131
131
  try {
132
- let scriptPath = `${req.contentPath}${req.body.route}/${req.body.script}.js`;
132
+ let scriptPath = path.join(req.contentPath, req.body.route, `${req.body.script}.js`);
133
133
 
134
134
  let script, result = null;
135
135