notherbase-fs 4.5.1 → 4.5.3
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 +3 -3
- package/package.json +1 -1
- package/server/creation.js +4 -5
package/notherbase-fs.js
CHANGED
|
@@ -21,10 +21,10 @@ class NotherBaseFS {
|
|
|
21
21
|
constructor(globals = {}, bases = {}) {
|
|
22
22
|
this.bases = bases;
|
|
23
23
|
|
|
24
|
-
this.initServer();
|
|
24
|
+
this.initServer(globals);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
initServer() {
|
|
27
|
+
initServer(globals) {
|
|
28
28
|
this.app = express();
|
|
29
29
|
this.server = http.createServer(this.app);
|
|
30
30
|
this.io = new Server(this.server);
|
|
@@ -100,7 +100,7 @@ class NotherBaseFS {
|
|
|
100
100
|
this.app.use(async (req, res, next) => {
|
|
101
101
|
req.Spirit = Spirit;
|
|
102
102
|
req.SendMail = SendMail;
|
|
103
|
-
req.globals = globals
|
|
103
|
+
req.globals = globals;
|
|
104
104
|
req.user = req.session?.currentUser ? await req.Spirit.findOne({ service: "user", username: req.session.currentUser }) : null;
|
|
105
105
|
req.lock = false;
|
|
106
106
|
// enables sessions only if the protocol is https and we are in production, or if we are in development
|
package/package.json
CHANGED
package/server/creation.js
CHANGED
|
@@ -10,11 +10,10 @@ export default class Creation {
|
|
|
10
10
|
this.router = express.Router();
|
|
11
11
|
|
|
12
12
|
this.router.get("/", this.explore);
|
|
13
|
-
this.router.get("
|
|
14
|
-
this.router.get(
|
|
15
|
-
this.router.get(
|
|
16
|
-
this.router.get(
|
|
17
|
-
this.router.get(`/:region/:area/:poi/:detail`, this.lock, this.explore);
|
|
13
|
+
this.router.get("/:region", this.explore);
|
|
14
|
+
this.router.get("/:region/:area", this.explore);
|
|
15
|
+
this.router.get("/:region/:area/:poi", this.explore);
|
|
16
|
+
this.router.get("/:region/:area/:poi/:detail", this.explore);
|
|
18
17
|
|
|
19
18
|
//void
|
|
20
19
|
this.router.use(function(req, res) {
|