16 lines
553 B
TypeScript
16 lines
553 B
TypeScript
import axios from 'axios'
|
|
import { NextResponse } from 'next/server'
|
|
|
|
export async function GET(request: Request) {
|
|
const { searchParams } = new URL(request.url)
|
|
const encodeFileNo = searchParams.get('encodeFileNo')
|
|
|
|
if (!encodeFileNo) {
|
|
return NextResponse.json({ error: 'fileNo is required' }, { status: 400 })
|
|
}
|
|
const response = await axios.get(`${process.env.NEXT_PUBLIC_INQUIRY_API_URL}/api/file/downloadFile?encodeFileNo=${encodeFileNo}`)
|
|
console.log('response.data:: ', response.data)
|
|
|
|
return NextResponse.json(response.data)
|
|
}
|