Skip to content

Commit

Permalink
Update NGINX-server.diff
Browse files Browse the repository at this point in the history
Signed-off-by: Elijah Bodden <[email protected]>
  • Loading branch information
Elijah-Bodden authored Aug 11, 2022
1 parent c233374 commit 5745d81
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions .productionConfig/NGINX-server.diff
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
5a6
> const express = require("express");
< const express = require("express");
6a8
> const path = require("path");
< const path = require("path");
8a11,12
> const helmet = require("helmet");
> const rateLimit = require("express-rate-limit");
< const helmet = require("helmet");
< const rateLimit = require("express-rate-limit");
50a55,61
> const rateLimiter = rateLimit({
> max: 1000,
> windowMs: 360000,
> message:
> "RateLimiterRejection: more than 1000 requests made from this IP in the last hour",
> });
>
< const rateLimiter = rateLimit({
< max: 1000,
< windowMs: 360000,
< message:
< "RateLimiterRejection: more than 1000 requests made from this IP in the last hour",
< });
<
52a64,74
> const expressFrontend = express();
> const ROOT = path.join(__dirname, "../frontend/dist");
> expressFrontend.use(express.static(ROOT));
> expressFrontend.use(helmet());
> expressFrontend.use(rateLimiter);
> expressFrontend.get("/", async function (req, res) {
> res.sendFile(ROOT);
> });
> expressFrontend.get("*", async function (req, res) {
> res.redirect("/");
> });
< const expressFrontend = express();
< const ROOT = path.join(__dirname, "../frontend/dist");
< expressFrontend.use(express.static(ROOT));
< expressFrontend.use(helmet());
< expressFrontend.use(rateLimiter);
< expressFrontend.get("/", async function (req, res) {
< res.sendFile(ROOT);
< });
< expressFrontend.get("*", async function (req, res) {
< res.redirect("/");
< });
186c208,209
< websocketServer.listen(8192);
> websocketServer.listen(8192);
---
> websocketServer.listen(8777);
> expressFrontend.listen(8000);
411d433
<
< websocketServer.listen(8777);
< expressFrontend.listen(8000);
411d433

0 comments on commit 5745d81

Please sign in to comment.