notherbase-fs 4.0.1 → 4.0.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 CHANGED
@@ -21,7 +21,6 @@ class NotherBaseFS {
21
21
  this.bases = bases;
22
22
  let baseKeys = Object.keys(this.bases);
23
23
  for (let i = 0; i < baseKeys.length; i++) {
24
- this.bases[baseKeys[i]].directory = fileURLToPath(new URL(this.bases[baseKeys[i]].directory, import.meta.url));
25
24
  this.bases[baseKeys[i]].static = express.static(this.bases[baseKeys[i]].directory + "/public");
26
25
  this.bases[baseKeys[i]].favicon = favicon(this.bases[baseKeys[i]].directory + this.bases[baseKeys[i]].icon);
27
26
  this.bases[baseKeys[i]].session = session({
@@ -71,7 +70,7 @@ class NotherBaseFS {
71
70
  });
72
71
 
73
72
  // allows us to get static files like css
74
- this.app.use(express.static('public'));
73
+ this.app.use(express.static(`${__dirname}/public`));
75
74
  this.app.use((req, res, next) => {
76
75
  this.bases[req.hosting].static(req, res, next);
77
76
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
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
@@ -1,12 +1,13 @@
1
1
  import NotherBaseFS from "./notherbase-fs.js";
2
+ import { fileURLToPath } from 'node:url';
2
3
 
3
4
  const notherBaseFS = new NotherBaseFS({}, {
4
5
  notherbase: {
5
- directory: './test',
6
+ directory: fileURLToPath(new URL('./test', import.meta.url)),
6
7
  icon: '/public/drum.png'
7
8
  },
8
9
  test: {
9
- directory: './test2',
10
+ directory: fileURLToPath(new URL('./test2', import.meta.url)),
10
11
  icon: '/public/drum.png'
11
12
  }
12
13
  });