mirror of
https://github.com/neongamerbot-qk/hackclub-nest
synced 2024-11-13 20:59:36 +00:00
enhancement(lint): Fix lint errors for hackclub-spotify-bot/src/index.js
Some checks failed
Remote SSH Command / Build (push) Has been cancelled
Some checks failed
Remote SSH Command / Build (push) Has been cancelled
Co-authored-by: NeonGamerBot-QK <saahilattud@gmail.com> Signed-off-by: zeon-neon[bot] <136533918+zeon-neon[bot]@users.noreply.github.com>
This commit is contained in:
parent
380f922013
commit
6e06c8ed98
1 changed files with 8 additions and 8 deletions
|
@ -2,7 +2,7 @@ const path = require("path");
|
|||
require("dotenv").config();
|
||||
const express = require("express");
|
||||
const session = require("express-session");
|
||||
const rateLimit = require('express-rate-limit');
|
||||
const rateLimit = require("express-rate-limit");
|
||||
const FileStore = require("session-file-store")(session);
|
||||
const { InstallProvider, FileInstallationStore } = require("@slack/oauth");
|
||||
const {
|
||||
|
@ -186,15 +186,15 @@ app.get("/download/db", async (req, res) => {
|
|||
res.send(csvData);
|
||||
});
|
||||
const limiter = rateLimit({
|
||||
windowMs: 1 * 60 * 1000, // 1 minutes
|
||||
limit: 5, // Limit each IP to 100 requests per `window` (here, per 15 minutes).
|
||||
standardHeaders: 'draft-7', // draft-6: `RateLimit-*` headers; draft-7: combined `RateLimit` header
|
||||
legacyHeaders: false, // Disable the `X-RateLimit-*` headers.
|
||||
// store: ... , // Redis, Memcached, etc. See below.
|
||||
})
|
||||
windowMs: 1 * 60 * 1000, // 1 minutes
|
||||
limit: 5, // Limit each IP to 100 requests per `window` (here, per 15 minutes).
|
||||
standardHeaders: "draft-7", // draft-6: `RateLimit-*` headers; draft-7: combined `RateLimit` header
|
||||
legacyHeaders: false, // Disable the `X-RateLimit-*` headers.
|
||||
// store: ... , // Redis, Memcached, etc. See below.
|
||||
});
|
||||
|
||||
// Apply the rate limiting middleware to all requests.
|
||||
app.use(limiter)
|
||||
app.use(limiter);
|
||||
app.post("/spotify/submitsong", async (req, res) => {
|
||||
if (!req.session.token) return res.redirect("/login");
|
||||
if (!cacheDb[req.query.token]) return res.redirect(`/home?error=0`);
|
||||
|
|
Loading…
Reference in a new issue