Skip to content

Commit

Permalink
rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
potts99 committed Nov 25, 2023
1 parent 57c8cef commit f007c59
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
3 changes: 2 additions & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
"dependencies": {
"@fastify/cookie": "^9.0.4",
"@fastify/cors": "^8.3.0",
"@fastify/rate-limit": "^9.0.0",
"@fastify/session": "^10.4.0",
"@fastify/swagger": "^8.10.0",
"@prisma/client": "^5.2.0",
"@prisma/client": "5.2.0",
"axios": "^1.5.0",
"bcrypt": "^5.0.1",
"dotenv": "^16.0.0",
Expand Down
5 changes: 5 additions & 0 deletions apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ server.register(require("@fastify/swagger"), {
},
});

server.register(import("@fastify/rate-limit"), {
max: 20,
timeWindow: "1 minute",
});

// register all routes
registerRoutes(server);

Expand Down
Empty file.
37 changes: 28 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@
dependencies:
fast-json-stringify "^5.7.0"

"@fastify/rate-limit@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@fastify/rate-limit/-/rate-limit-9.0.0.tgz#a69389c0bd565346e763abb7fae5993724eaff20"
integrity sha512-Gt5NXYyidUY47yO0QFvwwVwolbpFcq8Y6wSL0iV8v29IdUQVKhE9hcJE5N48LdnhTQDBdLiZDiR7nV4niMfOWw==
dependencies:
"@lukeed/ms" "^2.0.1"
fastify-plugin "^4.0.0"
toad-cache "^3.3.0"

"@fastify/session@^10.4.0":
version "10.6.0"
resolved "https://registry.yarnpkg.com/@fastify/session/-/session-10.6.0.tgz#fcbcc1d36eb22bb7f03dda6b80aacffa335d89ec"
Expand Down Expand Up @@ -531,6 +540,11 @@
titleize "2"
tlds "^1.230.0"

"@lukeed/ms@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@lukeed/ms/-/ms-2.0.1.tgz#3c2bbc258affd9cc0e0cc7828477383c73afa6ee"
integrity sha512-Xs/4RZltsAL7pkvaNStUQt7netTkyxrS0K+RILcVr3TRMS/ToOg4I6uNfhB9SlGsnWBym4U+EaXq0f0cEMNkHA==

"@mantine/core@^6.0.13":
version "6.0.21"
resolved "https://registry.yarnpkg.com/@mantine/core/-/core-6.0.21.tgz#6e3a1b8d0f6869518a644d5f5e3d55a5db7e1e51"
Expand Down Expand Up @@ -767,17 +781,17 @@
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==

"@prisma/client@^5.2.0":
version "5.6.0"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.6.0.tgz#1c15932250d5658fe0127e62faf4ecd96a877259"
integrity sha512-mUDefQFa1wWqk4+JhKPYq8BdVoFk9NFMBXUI8jAkBfQTtgx8WPx02U2HB/XbAz3GSUJpeJOKJQtNvaAIDs6sug==
"@prisma/[email protected]":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.2.0.tgz#cbfdd440614b38736563a7999f39922fcde0ed50"
integrity sha512-AiTjJwR4J5Rh6Z/9ZKrBBLel3/5DzUNntMohOy7yObVnVoTNVFi2kvpLZlFuKO50d7yDspOtW6XBpiAd0BVXbQ==
dependencies:
"@prisma/engines-version" "5.6.0-32.e95e739751f42d8ca026f6b910f5a2dc5adeaeee"
"@prisma/engines-version" "5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f"

"@prisma/engines-version@5.6.0-32.e95e739751f42d8ca026f6b910f5a2dc5adeaeee":
version "5.6.0-32.e95e739751f42d8ca026f6b910f5a2dc5adeaeee"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.6.0-32.e95e739751f42d8ca026f6b910f5a2dc5adeaeee.tgz#57b003ab5e1ea1523b5cdd7f06b24ebcf5c7fd8c"
integrity sha512-UoFgbV1awGL/3wXuUK3GDaX2SolqczeeJ5b4FVec9tzeGbSWJboPSbT0psSrmgYAKiKnkOPFSLlH6+b+IyOwAw==
"@prisma/engines-version@5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f":
version "5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f.tgz#11366e7ff031c908debf4983248d40046016de37"
integrity sha512-jsnKT5JIDIE01lAeCj2ghY9IwxkedhKNvxQeoyLs6dr4ZXynetD0vTy7u6wMJt8vVPv8I5DPy/I4CFaoXAgbtg==

"@prisma/[email protected]":
version "5.6.0"
Expand Down Expand Up @@ -6850,6 +6864,11 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

toad-cache@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/toad-cache/-/toad-cache-3.3.0.tgz#5b7dc67b36bc8b960567eb77bdf9ac6c26f204a1"
integrity sha512-3oDzcogWGHZdkwrHyvJVpPjA7oNzY6ENOV3PsWJY9XYPZ6INo94Yd47s5may1U+nleBPwDhrRiTPMIvKaa3MQg==

toggle-selection@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32"
Expand Down

0 comments on commit f007c59

Please sign in to comment.