import { t as Exception } from "./const-Dy5RfQqP.js";
import { i as useRequestHandler } from "./request-handler-guINVc1G.js";
//#region .svelte-kit/adapter-bun/entries/endpoints/fs/build/_server.ts.js
/**
* To request a built file, use the following URL:
* /fs/build?path=path/to/file
* The path must be relative to /.nanoforge/client
* Only the client is handled for now
*/
var GET = useRequestHandler(({ event, project }) => {
	const path = event.url.searchParams.get("path");
	if (!path) throw new Exception("Bad Request", "Missing path query param", 400);
	const stream = project.client.loader.getFile(decodeURIComponent(path).replace(/\?url$/, "")).readStream();
	return new Response(stream);
});
//#endregion
export { GET };

//# sourceMappingURL=_server.ts-a-I4s4R9.js.map