import { ImageResponse } from "@vercel/og"; import { RedisEdge } from "redis-edge"; const REDIS_COUNT_KEY = "og-count-2"; export const config = { runtime: "experimental-edge", }; export default async function () { const redis = new RedisEdge( process.env.UPSTASH_REDIS_ENDPOINT as string, process.env.UPSTASH_REDIS_PASSWORD as string ); console.log(redis); await redis.set("yo", "boba"); const currentCount = await redis.get(REDIS_COUNT_KEY); const status = await redis.incr(REDIS_COUNT_KEY); console.log(currentCount, status); // await fetch("https://global-promoted-ape-30182.upstash.io/incr/bar", { // headers: { // Authorization: // "Bearer AXXmACQgYWY1MzI2NjUtMjJmYi00NDAxLTkxOTItNTJkYTAwMWEzNDViNWI2YzFmZDljY2M4NDdiYzg1NjZhZTlhMDNjYWM2ZWI=", // }, // }) // .then((response) => response.json()) // .then((data) => console.log(data)); return new ImageResponse( (

Seen {currentCount || 0} times.

), { width: 1200, height: 600, } ); }