mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-06 23:44:19 +08:00
added rate limiter
This commit is contained in:
parent
576e2e3ab7
commit
45eb1e8a40
1 changed files with 3 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
} from "../../middlewares/api-utils";
|
||||
import * as ConfigurationController from "../controllers/configuration";
|
||||
import { authenticateRequest } from "../../middlewares/auth";
|
||||
import { onePerMin } from "../../middlewares/rate-limit";
|
||||
|
||||
const router = Router();
|
||||
|
||||
|
|
@ -21,6 +22,7 @@ router.get("/", asyncHandler(ConfigurationController.getConfiguration));
|
|||
|
||||
router.patch(
|
||||
"/",
|
||||
onePerMin,
|
||||
useInProduction([authenticateRequest(), checkIfUserIsConfigurationMod]),
|
||||
validateRequest({
|
||||
body: {
|
||||
|
|
@ -32,6 +34,7 @@ router.patch(
|
|||
|
||||
router.get(
|
||||
"/schema",
|
||||
onePerMin,
|
||||
useInProduction([authenticateRequest(), checkIfUserIsConfigurationMod]),
|
||||
asyncHandler(ConfigurationController.getSchema)
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue