UPSTASH_REDIS_REST_URL
UPSTASH_REDIS_REST_TOKEN
import { serve } from "https://deno.land/std@0.142.0/http/server.ts"; import { Redis } from "https://deno.land/x/upstash_redis@v1.14.0/mod.ts"; serve(async (_req: Request) => { if (!_req.url.endsWith("favicon.ico")) { const redis = new Redis({ url: "https://global-smart-lizard-32830.upstash.io", token: "AXV0NzFjNjQtZjg1Yy00YTgdfg765tyjhZDg3MmUyYmQ6765MDg", }); const counter = await redis.incr("deno-counter"); return new Response(JSON.stringify({ counter }), { status: 200 }); } });
Save & Deploy
Was this page helpful?