use environment variables from cloudflare's environment
This commit is contained in:
+10
-1
@@ -1,12 +1,21 @@
|
||||
import type { TSchema } from "@sinclair/typebox";
|
||||
import { TypeCompiler } from "@sinclair/typebox/compiler";
|
||||
import { initTRPC, TRPCError } from "@trpc/server";
|
||||
import type { getDb } from "../database/postgres";
|
||||
import type { getOpenrouter } from "../pages/chat/provider";
|
||||
|
||||
/**
|
||||
* Initialization of tRPC backend
|
||||
* Should be done only once per backend!
|
||||
*/
|
||||
const t = initTRPC.context<object>().create(/*{
|
||||
const t = initTRPC
|
||||
.context<
|
||||
object & {
|
||||
db: ReturnType<typeof getDb>;
|
||||
openrouter: ReturnType<typeof getOpenrouter>;
|
||||
}
|
||||
>()
|
||||
.create(/*{
|
||||
sse: {
|
||||
maxDurationMs: 5 * 60 * 1_000, // 5 minutes
|
||||
ping: {
|
||||
|
||||
Reference in New Issue
Block a user