import { isR2, readFileFromR2 } from "./r2.js";
import { readFileFromDisk } from "./disk.js";
export async function readFile(file) {
    if (isR2()) {
        return readFileFromR2(file);
    }
    else {
        return readFileFromDisk(file);
    }
}
export async function fetchFile(file) {
    const contents = await readFile(file);
    return new Response(contents, {
        status: contents ? 200 : 404
    });
}
//# sourceMappingURL=fetch.js.map