mirror of
https://gitbruv.vercel.app/api/git/bruv/gitbruv.git
synced 2025-12-20 23:24:09 +01:00
linting
This commit is contained in:
parent
4249f028aa
commit
468781e311
20 changed files with 84 additions and 185 deletions
|
|
@ -1,22 +1,19 @@
|
|||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { r2Get } from "@/lib/r2";
|
||||
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ filename: string }> }
|
||||
) {
|
||||
export async function GET(request: NextRequest, { params }: { params: Promise<{ filename: string }> }) {
|
||||
const { filename } = await params;
|
||||
|
||||
|
||||
const key = `avatars/${filename}`;
|
||||
const data = await r2Get(key);
|
||||
|
||||
|
||||
if (!data) {
|
||||
return new NextResponse(null, { status: 404 });
|
||||
}
|
||||
|
||||
const ext = filename.split(".").pop()?.toLowerCase();
|
||||
let contentType = "image/png";
|
||||
|
||||
|
||||
if (ext === "jpg" || ext === "jpeg") {
|
||||
contentType = "image/jpeg";
|
||||
} else if (ext === "gif") {
|
||||
|
|
@ -32,4 +29,3 @@ export async function GET(
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue