Skip to content

Commit

Permalink
Merge pull request #1 from sevans045/add-cors
Browse files Browse the repository at this point in the history
Add cors
  • Loading branch information
sevans045 authored Jun 16, 2024
2 parents 64d406f + 39f4185 commit 0b232a3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const {

const fs = require("fs");
const app = require("express")();
const cors = require("cors");
const rateLimit = require("express-rate-limit");
const limiter = rateLimit({
windowMs: rateLimitWindowDurationMinutes * 60 * 1000,
Expand All @@ -34,6 +35,7 @@ const routes = require("./routes/");

app.use("/api", routes);
app.use(limiter);
app.use(cors);

if (isBehindProxy) {
app.set("trust proxy", 1);
Expand Down
35 changes: 35 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"license": "ISC",
"dependencies": {
"axios": "^0.23.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"express-rate-limit": "^5.5.1",
"fs": "^0.0.1-security",
Expand Down

0 comments on commit 0b232a3

Please sign in to comment.