feat
Desc: - Penambahan api get foto profile
This commit is contained in:
11
src/app/api/profile/foto/[name]/route.ts
Normal file
11
src/app/api/profile/foto/[name]/route.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
import fs from 'fs'
|
||||||
|
|
||||||
|
export async function GET(req: NextRequest, { params }: { params: { name: string } }) {
|
||||||
|
const fl = fs.readFileSync(`./public/img/${params.name}`)
|
||||||
|
return new NextResponse(fl, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "image/png"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user