upd: profile

Deskripsi:
- edit profile
- api image
- folder image user

No Issues
This commit is contained in:
amel
2024-08-29 15:50:04 +08:00
parent 9eb2b1e4af
commit 44ea8c6510
14 changed files with 181 additions and 132 deletions

View File

@@ -0,0 +1,22 @@
import { NextRequest, NextResponse } from "next/server"
import fs from 'fs'
export async function GET(request: Request) {
let fl;
try {
const { searchParams } = new URL(request.url);
const kategori = searchParams.get('cat');
const file = searchParams.get('file');
fl = fs.readFileSync(`./public/image/${kategori}/${file}`)
} catch (err: any) {
throw err;
}
return new NextResponse(fl, {
headers: {
"Content-Type": "image/png"
}
})
}