selfhostable, read-only reddit client
16
fork

Configure Feed

Select the types of activity you want to include in your feed.

testing in prod

Akshay 3551ff7a 0003c28d

+10 -10
+9 -9
src/index.js
··· 17 17 app.use(express.urlencoded({ extended: true })); 18 18 app.use(express.static(path.join(__dirname, "public"))); 19 19 app.use(cookieParser()); 20 - // app.use( 21 - // rateLimit({ 22 - // windowMs: 15 * 60 * 1000, 23 - // max: 100, 24 - // message: "Too many requests from this IP, please try again later.", 25 - // standardHeaders: true, 26 - // legacyHeaders: false, 27 - // }), 28 - // ); 20 + app.use( 21 + rateLimit({ 22 + windowMs: 15 * 60 * 1000, 23 + max: 100, 24 + message: "Too many requests from this IP, please try again later.", 25 + standardHeaders: true, 26 + legacyHeaders: false, 27 + }), 28 + ); 29 29 app.use("/", routes); 30 30 31 31 const port = process.env.READIT_PORT;
+1 -1
src/routes/index.js
··· 126 126 127 127 router.get("/create-invite", authenticateAdmin, async (req, res) => { 128 128 function generateInviteToken() { 129 - const hasher = new Bun.CryptoHasher("sha256", "super-secret-invite-key"); 129 + const hasher = new Bun.CryptoHasher("sha256"); 130 130 return hasher.update(Math.random().toString()).digest("hex").slice(0, 10); 131 131 } 132 132