Skip to content

Commit

Permalink
1 fix code scanning alert missing rate limiting (#2)
Browse files Browse the repository at this point in the history
* chore: Update server.js to serve static files and handle SPA routing with rate limiting

* refactor: Update server.js to serve static files and handle SPA routing with rate limiting
  • Loading branch information
nilgaar authored Jul 20, 2024
1 parent c26ea8f commit f786d7a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
const express = require("express");
const path = require("path");
const app = express();
const PORT = process.env.PORT || 3000;
const RateLimit = require("express-rate-limit");

const app = express();

const limiter = new RateLimit({
windowMs: 1 * 60 * 1000,
max: 50,
});

app.use(limiter);

app.use(express.static(path.join(__dirname, "dist")));

Expand Down

0 comments on commit f786d7a

Please sign in to comment.