@cocreate/file-server 1.0.0 → 1.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.0.2](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.0.1...v1.0.2) (2022-12-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * console.log to trace error in deployment ([4f9c11f](https://github.com/CoCreate-app/CoCreate-file-server/commit/4f9c11f886ad113c008c2464e734d2172dc11ee2))
7
+
8
+ ## [1.0.1](https://github.com/CoCreate-app/CoCreate-file-server/compare/v1.0.0...v1.0.1) (2022-12-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * if file.document ([f9d4e38](https://github.com/CoCreate-app/CoCreate-file-server/commit/f9d4e38b00bbdef7912bee6964797b8957ff189b))
14
+
1
15
  # 1.0.0 (2022-12-04)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/file-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A simple file-server component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "file-server",
package/src/index.js CHANGED
@@ -35,6 +35,9 @@ class CoCreateFileSystem {
35
35
  return res.send('Organization cannot be found using the domain: ' + hostname + ' in platformDB: ' + masterOrg);
36
36
  organization_id = organization.document[0]._id
37
37
  }
38
+ console.log('file-server-----', organization.document[0], organization_id, organization_id.toString())
39
+ console.log('file-server-----', organization_id.toString())
40
+
38
41
  let [url, parameters] = req.url.split("?");
39
42
  if (parameters){}
40
43
  if (url.endsWith('/')) {
@@ -61,7 +64,7 @@ class CoCreateFileSystem {
61
64
  organization_id
62
65
  });
63
66
 
64
- if (!file || !file.document[0])
67
+ if (!file || !file.document || !file.document[0])
65
68
  return res.status(404).send(`${url} could not be found for ${organization_id} `);
66
69
 
67
70
  file = file.document[0]