aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkshay <[email protected]>2024-11-19 22:43:12 +0000
committerAkshay <[email protected]>2024-11-19 22:43:12 +0000
commit3551ff7a202ad60362888888c42f88b37e32fc59 (patch)
treec0f2b16f427a92178683014e63d043f3b3c00f5f /src
parent0003c28d8b042c080776b0f7ad046bca3ba6ae39 (diff)
testing in prod
Diffstat (limited to 'src')
-rw-r--r--src/index.js18
-rw-r--r--src/routes/index.js2
2 files changed, 10 insertions, 10 deletions
diff --git a/src/index.js b/src/index.js
index 49f1349..6296534 100644
--- a/src/index.js
+++ b/src/index.js
@@ -17,15 +17,15 @@ app.use(express.json());
17app.use(express.urlencoded({ extended: true })); 17app.use(express.urlencoded({ extended: true }));
18app.use(express.static(path.join(__dirname, "public"))); 18app.use(express.static(path.join(__dirname, "public")));
19app.use(cookieParser()); 19app.use(cookieParser());
20// app.use( 20app.use(
21// rateLimit({ 21 rateLimit({
22// windowMs: 15 * 60 * 1000, 22 windowMs: 15 * 60 * 1000,
23// max: 100, 23 max: 100,
24// message: "Too many requests from this IP, please try again later.", 24 message: "Too many requests from this IP, please try again later.",
25// standardHeaders: true, 25 standardHeaders: true,
26// legacyHeaders: false, 26 legacyHeaders: false,
27// }), 27 }),
28// ); 28);
29app.use("/", routes); 29app.use("/", routes);
30 30
31const port = process.env.READIT_PORT; 31const port = process.env.READIT_PORT;
diff --git a/src/routes/index.js b/src/routes/index.js
index 4bc45cd..9a415be 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -126,7 +126,7 @@ router.get("/dashboard", authenticateToken, async (req, res) => {
126 126
127router.get("/create-invite", authenticateAdmin, async (req, res) => { 127router.get("/create-invite", authenticateAdmin, async (req, res) => {
128 function generateInviteToken() { 128 function generateInviteToken() {
129 const hasher = new Bun.CryptoHasher("sha256", "super-secret-invite-key"); 129 const hasher = new Bun.CryptoHasher("sha256");
130 return hasher.update(Math.random().toString()).digest("hex").slice(0, 10); 130 return hasher.update(Math.random().toString()).digest("hex").slice(0, 10);
131 } 131 }
132 132