TanStackT
TanStack3mo ago
35 replies
good-rose

Is there a way to set a global server context?

I'd like to have some objects passed in to every request handlers (e.g. createFileRoute, createServerFn) (kind of like a server context, NOT a request context). Some of these objects would be:
- a database connection (created via createServerOnlyFn)
- a parsed env object containing environment variables and other settings
- objects representing a connection to other services
Was this page helpful?