mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: ♻️ Don't use Bun global
This commit is contained in:
parent
d55668d529
commit
25ea870f71
15 changed files with 32 additions and 19 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { apiRoute, handleZodError } from "@/api";
|
||||
import { file as bunFile } from "bun";
|
||||
import { describeRoute } from "hono-openapi";
|
||||
import { resolver, validator } from "hono-openapi/zod";
|
||||
import { z } from "zod";
|
||||
|
|
@ -57,7 +58,7 @@ export default apiRoute((app) =>
|
|||
.map(Number); // [0, 100]
|
||||
|
||||
// Serve file from filesystem
|
||||
const file = Bun.file(`./uploads/${hash}/${name}`);
|
||||
const file = bunFile(`./uploads/${hash}/${name}`);
|
||||
|
||||
const buffer = await file.arrayBuffer();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue