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

17 lines
480 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 = {
2024-08-27 13:15:36 +02:00
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;