Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

chore: use eventsource polyfil for headers support

thecodrr15954f3d5d6c
diff --git a/apps/web/package.json b/apps/web/package.json
index b590e7e8f..2462b0751 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -21,6 +21,7 @@
"currency-symbol-map": "^5.0.1",
"dayjs": "^1.10.4",
"emotion-theming": "^10.0.19",
+ "event-source-polyfill": "^1.0.25",
"fast-sort": "^2.1.1",
"file-saver": "^2.0.5",
"framer-motion": "^4.1.17",
diff --git a/apps/web/src/common/db.js b/apps/web/src/common/db.js
index c4b7758a2..5a426cb9c 100644
--- a/apps/web/src/common/db.js
+++ b/apps/web/src/common/db.js
@@ -1,3 +1,8 @@
+import { EventSourcePolyfill as EventSource } from "event-source-polyfill";
+//const EventSource = NativeEventSource || EventSourcePolyfill;
+// OR: may also need to set as global property
+//global.EventSource = NativeEventSource || EventSourcePolyfill;
+
global.HTMLParser = new DOMParser().parseFromString(
"<body></body>",
"text/html"
@@ -19,16 +24,16 @@ async function initializeDatabase() {
// SSE_HOST: "https://events.streetwriters.co",
// });
// } else {
- // db.host({
- // API_HOST: "http://localhost:5264",
- // AUTH_HOST: "http://localhost:8264",
- // SSE_HOST: "http://localhost:7264",
- // });
- // // db.host({
- // // API_HOST: "http://192.168.10.29:5264",
- // // AUTH_HOST: "http://192.168.10.29:8264",
- // // SSE_HOST: "http://192.168.10.29:7264",
- // // });
+ // db.host({
+ // API_HOST: "http://localhost:5264",
+ // AUTH_HOST: "http://localhost:8264",
+ // SSE_HOST: "http://localhost:7264",
+ // });
+ db.host({
+ API_HOST: "http://192.168.10.29:5264",
+ AUTH_HOST: "http://192.168.10.29:8264",
+ SSE_HOST: "http://192.168.10.29:7264",
+ });
// }
await db.init();