notherbase-fs 4.0.15 → 4.0.16

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.
Files changed (2) hide show
  1. package/notherbase-fs.js +11 -8
  2. package/package.json +1 -1
package/notherbase-fs.js CHANGED
@@ -19,6 +19,16 @@ import MongoStore from 'connect-mongo';
19
19
  class NotherBaseFS {
20
20
  constructor(globals = {}, bases = {}) {
21
21
  this.bases = bases;
22
+
23
+ this.app = express();
24
+ this.server = http.createServer(this.app);
25
+ this.io = new Server(this.server);
26
+ this.spiritWorld = new SpiritWorld(this.io);
27
+ this.creation = new Creation(bases);
28
+
29
+ //be safe, needs to be before session
30
+ if (process.env.PRODUCTION == "true") this.app.set('trust proxy', 1);
31
+
22
32
  let baseKeys = Object.keys(this.bases);
23
33
  let mongoStore = MongoStore.create({ mongoUrl: process.env.MONGODB_URI });
24
34
  for (let i = 0; i < baseKeys.length; i++) {
@@ -36,12 +46,6 @@ class NotherBaseFS {
36
46
  }
37
47
  });
38
48
  }
39
-
40
- this.app = express();
41
- this.server = http.createServer(this.app);
42
- this.io = new Server(this.server);
43
- this.spiritWorld = new SpiritWorld(this.io);
44
- this.creation = new Creation(bases);
45
49
 
46
50
  //set views path
47
51
  this.app.set("view engine", "ejs");
@@ -71,8 +75,7 @@ class NotherBaseFS {
71
75
  this.bases[req.hosting].favicon(req, res, next);
72
76
  });
73
77
 
74
- //be safe, needs to be before session
75
- if (process.env.PRODUCTION == "true") this.app.set('trust proxy', 1);
78
+
76
79
 
77
80
  //enable cookies
78
81
  this.app.use((req, res, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "4.0.15",
3
+ "version": "4.0.16",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {