mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-28 09:21:00 +01:00
18 lines
399 B
TypeScript
18 lines
399 B
TypeScript
import { TRPCError } from "@trpc/server";
|
|
|
|
import { env } from "@homarr/docker/env";
|
|
|
|
import { publicProcedure } from "../trpc";
|
|
|
|
export const dockerMiddleware = () => {
|
|
return publicProcedure.use(async ({ next }) => {
|
|
if (env.ENABLE_DOCKER) {
|
|
return await next();
|
|
}
|
|
throw new TRPCError({
|
|
code: "NOT_FOUND",
|
|
message: "Docker route is not available",
|
|
});
|
|
});
|
|
};
|