add missing code

This commit is contained in:
Joel
2023-08-28 18:21:38 +08:00
parent 7305de467e
commit bf49c3c15d
2 changed files with 40 additions and 0 deletions

21
app/api/passport/route.ts Normal file
View File

@ -0,0 +1,21 @@
import { type NextRequest } from 'next/server'
import { client } from '@/app/api/utils/common'
import { API_KEY, API_URL, APP_ID } from '@/config'
// import { commonClient } from 'dify-client'
import axios from "axios";
export async function GET(request: NextRequest) {
const headers = {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
'X-App-Code': APP_ID
};
const res = await axios({
url: 'https://api.dify.ai/v1/passport',
headers,
responseType: "json",
})
console.log(res)
return new Response(res.data)
}