add img
This commit is contained in:
parent
7c2ed2b435
commit
eb1b38bca6
|
|
@ -0,0 +1,14 @@
|
|||
import { apiContext } from "service-srv";
|
||||
import { g } from "utils/global";
|
||||
|
||||
export const _ = {
|
||||
url: "/_img/**",
|
||||
async api() {
|
||||
const { req, res } = apiContext(this);
|
||||
const file = Bun.file(`${g.datadir}/upload/${req.params["*"]}`);
|
||||
if (await file.exists()) {
|
||||
return new Response(file as any);
|
||||
}
|
||||
return new Response("NOT FOUND", { status: 404 });
|
||||
},
|
||||
};
|
||||
Loading…
Reference in New Issue