svrjs-nextjs-website/app/api/uploadthing/core.ts

17 lines
485 B
TypeScript
Raw Normal View History

2024-06-20 19:46:48 +02:00
import { createUploadthing, type FileRouter } from "uploadthing/next";
import { UploadThingError } from "uploadthing/server";
const f = createUploadthing();
// const auth = (req: Request) => ({ id: "fakeId" });
export const ourFileRouter = {
imageUploader: f({
"application/zip": { maxFileSize: "8MB" }
}).onUploadComplete(async ({ metadata, file }) => {
console.log("file url", file.url);
})
2024-06-20 19:46:48 +02:00
} satisfies FileRouter;
export type OurFileRouter = typeof ourFileRouter;