notherbase-fs 3.2.15 → 3.2.17

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.
@@ -5,7 +5,8 @@ import fs from 'fs';
5
5
  * Creation is all the renedered pages in a base.
6
6
  */
7
7
  export default class Creation {
8
- constructor() {
8
+ constructor(siteTitle = "Base") {
9
+ this.siteTitle = siteTitle;
9
10
  this.router = express.Router();
10
11
 
11
12
  //home
@@ -88,7 +89,7 @@ export default class Creation {
88
89
  */
89
90
  front = async (req, res, next) => {
90
91
  req.main = req.contentPath + "/the-front/index";
91
- req.siteTitle = "NotherBase - The Front";
92
+ req.siteTitle = this.siteTitle;
92
93
  req.toRender = "explorer";
93
94
  next();
94
95
  }
@@ -101,7 +102,7 @@ export default class Creation {
101
102
  */
102
103
  frontDetail = async (req, res, next) => {
103
104
  req.main = `${req.contentPath}/the-front/${req.params.frontDetail}/index`;
104
- req.siteTitle = `NotherBase - ${req.params.frontDetail}`;
105
+ req.siteTitle = `${this.siteTitle} - ${req.params.frontDetail}`;
105
106
  req.toRender = "explorer";
106
107
  next();
107
108
  }
@@ -114,7 +115,7 @@ export default class Creation {
114
115
  */
115
116
  poi = async (req, res, next) => {
116
117
  req.main = `${req.contentPath}/${req.params.region}/${req.params.area}/${req.params.poi}/index`;
117
- req.siteTitle = `NotherBase - ${req.params.poi}`;
118
+ req.siteTitle = `${this.siteTitle} - ${req.params.poi}`;
118
119
  req.toRender = "explorer";
119
120
  next();
120
121
  }
@@ -127,7 +128,7 @@ export default class Creation {
127
128
  */
128
129
  detail = async (req, res, next) => {
129
130
  req.main = `${req.contentPath}/${req.params.region}/${req.params.area}/${req.params.poi}/${req.params.detail}/index`;
130
- req.siteTitle = `NotherBase - ${req.params.detail}`;
131
+ req.siteTitle = `${this.siteTitle} - ${req.params.detail}`;
131
132
  req.toRender = "explorer";
132
133
  next();
133
134
  }
package/models/spirit.js CHANGED
@@ -66,10 +66,10 @@ export default class Spirit {
66
66
  * @param {String} service The name of the spirit.
67
67
  * @returns All spirits of the given name.
68
68
  */
69
- static recallAll = async (service) => {
69
+ static recallAll = async (service, extraQuery) => {
70
70
  let spirit = new Spirit();
71
71
 
72
- let found = await Spirit.db.find({ service: service });
72
+ let found = await Spirit.db.find({ service: service, ...extraQuery });
73
73
 
74
74
  if (found) {
75
75
  spirit.memory = found;
package/notherbase-fs.js CHANGED
@@ -17,11 +17,15 @@ import SpiritWorld from "./controllers/spirit-world.js";
17
17
  * The engine that runs a nother base.
18
18
  */
19
19
  class NotherBaseFS {
20
- constructor(contentPath, globals = null) {
20
+ constructor(contentPath, globals = null, settings = {}) {
21
+ this.settings = {
22
+ siteTitle: "NotherBase",
23
+ ...settings
24
+ }
21
25
  this.app = express();
22
26
  this.server = http.createServer(this.app);
23
27
  this.io = new Server(this.server);
24
- this.creation = new Creation();
28
+ this.creation = new Creation(this.settings.siteTitle);
25
29
  this.spiritWorld = new SpiritWorld(this.io);
26
30
 
27
31
  //set views path
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "3.2.15",
3
+ "version": "3.2.17",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {