Update index.mjs

This commit is contained in:
The Ghost of FOSS' Future 2024-08-22 20:41:07 +00:00 committed by GitHub
parent 60c9e91135
commit 1c9b69e15b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,6 +67,9 @@ 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