Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/v1/vaults/[vaultId].ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { VercelRequest, VercelResponse } from "@vercel/node";
import { KNOWN_POOLS } from "@meridian/stellar-sdk-helpers";
import { handleGetVaultById } from "@meridian/api-core";
import { applyCors } from "../../_lib/middleware.js";
import { applyCors, checkRateLimit } from "../../_lib/middleware.js";

const CACHE_CONTROL = "public, s-maxage=60, stale-while-revalidate=300";
const KNOWN_VAULT_IDS = new Set(
Expand All @@ -13,6 +13,7 @@ const KNOWN_VAULT_IDS = new Set(

export default async function handler(req: VercelRequest, res: VercelResponse) {
if (applyCors(req, res)) return;
if (!(await checkRateLimit(req, res))) return;
const raw = req.query["vaultId"];
const vaultId = typeof raw === "string" ? raw : undefined;
if (!vaultId) return res.status(400).json({ error: "vaultId is required" });
Expand Down
Loading