mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
refactor(api): ♻️ Remove old redirect() and response() in favour of Hono's builtins
This commit is contained in:
parent
691716f7eb
commit
69d7d50239
20 changed files with 188 additions and 174 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { apiRoute, applyConfig, handleZodError } from "@/api";
|
||||
import { response } from "@/response";
|
||||
import { zValidator } from "@hono/zod-validator";
|
||||
import { z } from "zod";
|
||||
|
||||
|
|
@ -54,7 +53,7 @@ export default apiRoute((app) =>
|
|||
}
|
||||
|
||||
// Can't directly copy file into Response because this crashes Bun for now
|
||||
return response(buffer, 200, {
|
||||
return context.newResponse(buffer, 200, {
|
||||
"Content-Type": file.type || "application/octet-stream",
|
||||
"Content-Length": `${file.size - start}`,
|
||||
"Content-Range": `bytes ${start}-${end}/${file.size}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue