Skip to content

Open source alternatives to paid SaaS apps: Notion, Slack, Auth0, Vercel and more. Curated list with licenses and GitHub stars.

Remove unrelated code files

Anil Chandra Naidu Matcha37b130bf5f9a
diff --git a/src/app/api/upload/route.js b/src/app/api/upload/route.js
deleted file mode 100644
index 7f76c18..0000000
--- a/src/app/api/upload/route.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import { NextResponse } from "next/server";
-import config from "@/lib/config";
-
-export async function POST(req) {
- try {
- const data = await req.formData();
- const file = data.get("file");
- const apiKey = config.ai.apiKey;
-
- if (!file) {
- return NextResponse.json({ error: "No file provided" }, { status: 400 });
- }
-
- if (!apiKey || apiKey.includes("your_") || apiKey.trim() === "") {
- // Local Base64 Fallback
- const bytes = await file.arrayBuffer();
- const buffer = Buffer.from(bytes);
- return NextResponse.json({ url: `data:${file.type};base64,${buffer.toString("base64")}` });
- }
-
- const fd = new FormData();
- fd.append("file", file);
-
- const uploadRes = await fetch(config.ai.uploadEndpoint || "https://api.muapi.ai/api/v1/upload_file", {
- method: "POST",
- headers: { "x-api-key": apiKey },
- body: fd
- });
-
- if (!uploadRes.ok) {
- const errText = await uploadRes.text();
- return NextResponse.json({ error: `Upload failed: ${errText}` }, { status: 500 });
- }
-
- const result = await uploadRes.json();
- return NextResponse.json({ url: result.url || result.file_url });
- } catch (error) {
- console.error("[UPLOAD_ERROR]", error);
- return NextResponse.json({ error: error.message || "Internal Upload Error" }, { status: 500 });
- }
-}