notherbase-fs 4.0.4 → 4.0.6

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.
@@ -1,6 +1,5 @@
1
1
  import express from "express";
2
2
  import fs from 'fs';
3
- import { fileURLToPath } from 'node:url';
4
3
 
5
4
  /**
6
5
  * Creation is all the renedered pages in a base.
@@ -90,7 +89,7 @@ export default class Creation {
90
89
  */
91
90
  front = async (req, res, next) => {
92
91
  req.main = req.contentPath + "/the-front/index";
93
- req.siteTitle = this.siteTitle;
92
+ req.siteTitle = this.bases[req.hosting].title;
94
93
  req.toRender = "explorer";
95
94
  next();
96
95
  }
@@ -103,7 +102,7 @@ export default class Creation {
103
102
  */
104
103
  frontDetail = async (req, res, next) => {
105
104
  req.main = `${req.contentPath}/the-front/${req.params.frontDetail}/index`;
106
- req.siteTitle = `${this.siteTitle} - ${req.params.frontDetail}`;
105
+ req.siteTitle = `${this.bases[req.hosting].title} - ${req.params.frontDetail}`;
107
106
  req.toRender = "explorer";
108
107
  next();
109
108
  }
@@ -116,7 +115,7 @@ export default class Creation {
116
115
  */
117
116
  poi = async (req, res, next) => {
118
117
  req.main = `${req.contentPath}/${req.params.region}/${req.params.area}/${req.params.poi}/index`;
119
- req.siteTitle = `${this.siteTitle} - ${req.params.poi}`;
118
+ req.siteTitle = `${this.bases[req.hosting].title} - ${req.params.poi}`;
120
119
  req.toRender = "explorer";
121
120
  next();
122
121
  }
@@ -129,7 +128,7 @@ export default class Creation {
129
128
  */
130
129
  detail = async (req, res, next) => {
131
130
  req.main = `${req.contentPath}/${req.params.region}/${req.params.area}/${req.params.poi}/${req.params.detail}/index`;
132
- req.siteTitle = `${this.siteTitle} - ${req.params.detail}`;
131
+ req.siteTitle = `${this.bases[req.hosting].title} - ${req.params.detail}`;
133
132
  req.toRender = "explorer";
134
133
  next();
135
134
  }
package/notherbase-fs.js CHANGED
@@ -56,6 +56,7 @@ class NotherBaseFS {
56
56
  //provide database access and etc to use in routes
57
57
  this.app.use((req, res, next) => {
58
58
  req.hosting = req.hostname.split(".")[0];
59
+ console.log(req.hosting, req.hostname);
59
60
  req.contentPath = this.bases[req.hosting].directory;
60
61
  next();
61
62
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "4.0.4",
3
+ "version": "4.0.6",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
package/test-index.js CHANGED
@@ -3,10 +3,12 @@ import { fileURLToPath } from 'node:url';
3
3
 
4
4
  const notherBaseFS = new NotherBaseFS({}, {
5
5
  notherbase: {
6
+ title: "NotherBase",
6
7
  directory: fileURLToPath(new URL('./test', import.meta.url)),
7
8
  icon: '/public/drum.png'
8
9
  },
9
10
  test: {
11
+ title: "TestBase",
10
12
  directory: fileURLToPath(new URL('./test2', import.meta.url)),
11
13
  icon: '/public/drum.png'
12
14
  }