Skip to content

Commit

Permalink
chore(sandbox): added vercel kv
Browse files Browse the repository at this point in the history
  • Loading branch information
MathurAditya724 committed Mar 20, 2024
1 parent 6c6c90d commit 547e78c
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 59 deletions.
6 changes: 5 additions & 1 deletion apps/sandbox/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { serve } from "@hono/node-server";
import { kv } from "@vercel/kv";
import { Hono } from "hono";
import { type RateLimitInfo, rateLimiter } from "hono-rate-limiter";
import { type RateLimitInfo, RedisStore, rateLimiter } from "hono-rate-limiter";
import { logger } from "hono/logger";
import Page from "./Page";

Expand All @@ -17,6 +18,9 @@ app.use(
rateLimiter({
windowMs: 10_000,
limit: 10,
// store: new RedisStore({
// sendCommand: (...args: string[]) => kv(args),
// }),
handler: (_, next) => next(),
}),
);
Expand Down
117 changes: 59 additions & 58 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,59 @@
{
"name": "@hono-ratelimiter/source",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"commit": "czg",
"prepare": "is-ci || husky install",
"format": "biome check --apply ."
},
"private": true,
"dependencies": {
"@hono/node-server": "^1.8.2",
"hono": "^4.1.1"
},
"devDependencies": {
"@biomejs/biome": "^1.6.1",
"@jscutlery/semver": "^5.2.0",
"@nx/esbuild": "18.1.1",
"@nx/eslint": "18.1.1",
"@nx/eslint-plugin": "18.1.1",
"@nx/js": "18.1.1",
"@nx/node": "18.1.1",
"@nx/vite": "18.1.1",
"@nx/web": "18.1.1",
"@nx/workspace": "18.1.1",
"@swc-node/register": "~1.8.0",
"@swc/cli": "~0.1.62",
"@swc/core": "~1.3.85",
"@swc/helpers": "~0.5.2",
"@types/ioredis-mock": "^8.2.5",
"@types/node": "18.16.9",
"@types/supertest": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@vitest/coverage-v8": "^1.0.4",
"@vitest/ui": "^1.3.1",
"czg": "^1.9.0",
"esbuild": "^0.19.2",
"eslint": "~8.48.0",
"eslint-config-prettier": "^9.0.0",
"husky": "^9.0.11",
"ioredis-mock": "^8.9.0",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.2",
"ngx-deploy-npm": "^8.0.1",
"nx": "18.1.1",
"prettier": "^2.6.2",
"supertest": "^6.3.4",
"tslib": "^2.6.2",
"typescript": "~5.3.2",
"verdaccio": "^5.0.4",
"vite": "~5.0.0",
"vitest": "^1.3.1"
},
"nx": {
"includedScripts": []
}
}
{
"name": "@hono-ratelimiter/source",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"commit": "czg",
"prepare": "is-ci || husky install",
"format": "biome check --apply ."
},
"private": true,
"dependencies": {
"@hono/node-server": "^1.8.2",
"@vercel/kv": "^1.0.1",
"hono": "^4.1.1"
},
"devDependencies": {
"@biomejs/biome": "^1.6.1",
"@jscutlery/semver": "^5.2.0",
"@nx/esbuild": "18.1.1",
"@nx/eslint": "18.1.1",
"@nx/eslint-plugin": "18.1.1",
"@nx/js": "18.1.1",
"@nx/node": "18.1.1",
"@nx/vite": "18.1.1",
"@nx/web": "18.1.1",
"@nx/workspace": "18.1.1",
"@swc-node/register": "~1.8.0",
"@swc/cli": "~0.1.62",
"@swc/core": "~1.3.85",
"@swc/helpers": "~0.5.2",
"@types/ioredis-mock": "^8.2.5",
"@types/node": "18.16.9",
"@types/supertest": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@vitest/coverage-v8": "^1.0.4",
"@vitest/ui": "^1.3.1",
"czg": "^1.9.0",
"esbuild": "^0.19.2",
"eslint": "~8.48.0",
"eslint-config-prettier": "^9.0.0",
"husky": "^9.0.11",
"ioredis-mock": "^8.9.0",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.2",
"ngx-deploy-npm": "^8.0.1",
"nx": "18.1.1",
"prettier": "^2.6.2",
"supertest": "^6.3.4",
"tslib": "^2.6.2",
"typescript": "~5.3.2",
"verdaccio": "^5.0.4",
"vite": "~5.0.0",
"vitest": "^1.3.1"
},
"nx": {
"includedScripts": []
}
}
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 547e78c

Please sign in to comment.