Files
freno-dev/src/server/api/routers/infill.ts
2025-12-28 14:40:38 -05:00

19 lines
582 B
TypeScript

import { publicProcedure, createTRPCRouter } from "~/server/api/utils";
import { env } from "~/env/server";
export const infillRouter = createTRPCRouter({
getConfig: publicProcedure.query(({ ctx }) => {
// Only admins get the config
if (ctx.privilegeLevel !== "admin") {
return { endpoint: null, token: null };
}
// Return endpoint and token (or null if not configured)
// Now supports both desktop and mobile (fullscreen mode)
return {
endpoint: env.VITE_INFILL_ENDPOINT || null,
token: env.INFILL_BEARER_TOKEN || null
};
})
});