From 1c9b69e15b5537b024633a1445f5590d67e45cff Mon Sep 17 00:00:00 2001 From: The Ghost of FOSS' Future <163201376+sneedgroup-holder@users.noreply.github.com> Date: Thu, 22 Aug 2024 20:41:07 +0000 Subject: [PATCH] Update index.mjs --- index.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.mjs b/index.mjs index b9620c4..4ccd267 100644 --- a/index.mjs +++ b/index.mjs @@ -67,8 +67,11 @@ async function main(port) { const hostname = '127.0.0.1'; const server = http.createServer((req, res) => { + res.setHeader('Access-Control-Allow-Origin', '*'); // Adjust as needed + res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); + res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); res.statusCode = 200; - + // Create URL object and parse query parameters const urlObj = new URL(req.url, `http://${req.headers.host}`); const queryParams = urlObj.searchParams; @@ -92,4 +95,4 @@ async function main(port) { }); } -main(8543) \ No newline at end of file +main(8543)