Spaces:
Sleeping
Sleeping
Update index.mjs
Browse files
index.mjs
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import express from "express";
|
2 |
import 'dotenv/config.js';
|
3 |
import { createServer } from "http";
|
|
|
1 |
+
// At the top of your index.mjs or wherever you're planning to use fetch
|
2 |
+
import fetch from 'node-fetch';
|
3 |
+
if (!globalThis.fetch) {
|
4 |
+
globalThis.fetch = fetch;
|
5 |
+
}
|
6 |
import express from "express";
|
7 |
import 'dotenv/config.js';
|
8 |
import { createServer } from "http";
|