feat: prepare supporter self-hosting
This commit is contained in:
@@ -30,6 +30,7 @@ interface MyRouterContext {
|
||||
trpc: TRPCOptionsProxy<AppRouter>;
|
||||
apiUrl: string;
|
||||
dashboardUrl: string;
|
||||
isSelfHosted: boolean;
|
||||
}
|
||||
|
||||
export const Route = createRootRouteWithContext<MyRouterContext>()({
|
||||
|
||||
19
apps/start/src/routes/api/config.tsx
Normal file
19
apps/start/src/routes/api/config.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Sidebar } from '@/components/sidebar';
|
||||
import { getServerEnvs } from '@/server/get-envs';
|
||||
import { Outlet, createFileRoute, redirect } from '@tanstack/react-router';
|
||||
|
||||
// Nothing sensitive here, its client environment variables which is good for debugging
|
||||
export const Route = createFileRoute('/api/config')({
|
||||
server: {
|
||||
handlers: {
|
||||
GET: async () => {
|
||||
const envs = await getServerEnvs();
|
||||
return new Response(JSON.stringify(envs), {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
11
apps/start/src/routes/api/healthcheck.tsx
Normal file
11
apps/start/src/routes/api/healthcheck.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
|
||||
export const Route = createFileRoute('/api/healthcheck')({
|
||||
server: {
|
||||
handlers: {
|
||||
GET: async () => {
|
||||
return new Response('OK');
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user