From eb1de15fe0513a4675c5b5edd72a0921761786a0 Mon Sep 17 00:00:00 2001 From: mia Date: Sat, 3 Feb 2024 19:41:38 -0800 Subject: [PATCH] add rate limit --- packages/backend/src/server/api/endpoints/bites/create.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/bites/create.ts b/packages/backend/src/server/api/endpoints/bites/create.ts index 060dc5f96..c4e28dee2 100644 --- a/packages/backend/src/server/api/endpoints/bites/create.ts +++ b/packages/backend/src/server/api/endpoints/bites/create.ts @@ -1,12 +1,18 @@ import { Bites } from "@/models/index.js"; import define from "../../define.js"; import { createBite } from "@/services/create-bite.js"; +import { MINUTE } from "@/const.js"; export const meta = { tags: ["bites"], requireCredential: true, + limit: { + duration: MINUTE, + max: 30, + }, + res: { type: "object", optional: false,