Skip to content

Commit

Permalink
fix cors
Browse files Browse the repository at this point in the history
  • Loading branch information
XboxBedrock authored Apr 14, 2024
1 parent 0cdc424 commit 3e8ca74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"ajv": "^6.12.4",
"eris": "https://github.com/Dragory/eris/archive/stickers-0.14.0.tar.gz",
"express": "^4.17.1",
"cors": "^2.8.5",
"helmet": "^4.1.1",
"humanize-duration": "^3.23.1",
"ini": "^1.3.6",
Expand Down
2 changes: 2 additions & 0 deletions src/modules/webserver.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const express = require("express");
const cors = require('cors')
const helmet = require("helmet");
const mime = require("mime");
const url = require("url");
Expand Down Expand Up @@ -56,6 +57,7 @@ function serveAttachments(req, res) {

const server = express();
server.use(helmet());
server.use(cors());

server.get("/logs/:threadId", serveLogs);
server.get("/attachments/:attachmentId/:filename", serveAttachments);
Expand Down

0 comments on commit 3e8ca74

Please sign in to comment.