feat: misc — cooking mode, OpenAPI docs, email, storage, upload, homepage
Cooking mode step-by-step view. OpenAPI 3.1 spec auto-generated from Zod schemas. Email lib (resend). Redis client. S3 storage helper. Photo upload endpoint. Landing page. Short recipe URL redirect /r/[id]. API docs page.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import Redis from "ioredis";
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line no-var
|
||||
var __redis: Redis | undefined;
|
||||
}
|
||||
|
||||
export function getRedis(): Redis {
|
||||
if (!globalThis.__redis) {
|
||||
globalThis.__redis = new Redis(
|
||||
process.env["REDIS_URL"] ?? "redis://localhost:6379",
|
||||
{ lazyConnect: false, maxRetriesPerRequest: 3 }
|
||||
);
|
||||
}
|
||||
return globalThis.__redis;
|
||||
}
|
||||
Reference in New Issue
Block a user