Initial export from WebStudio.is

This commit is contained in:
deterge
2025-10-08 18:18:41 -04:00
parent bb56cf1878
commit 903e016eec
54 changed files with 90905 additions and 0 deletions

24
app/routes/[_image].$.ts Normal file
View File

@@ -0,0 +1,24 @@
import { env } from "node:process";
import type { LoaderFunctionArgs } from "react-router";
import {
createIPX,
createIPXH3Handler,
ipxFSStorage,
ipxHttpStorage,
} from "ipx";
import { createApp, toWebHandler } from "h3";
const domains = env.DOMAINS?.split(/\s*,\s*/) ?? [];
const ipx = createIPX({
storage: ipxFSStorage({ dir: "./public" }),
httpStorage: ipxHttpStorage({ domains }),
});
const handleRequest = toWebHandler(
createApp().use("/_image", createIPXH3Handler(ipx))
);
export const loader = async (args: LoaderFunctionArgs) => {
return handleRequest(args.request);
};