题意:运行 azure api 时遇到的错误提示。
问题背景:
When I ran npm run dev
in the console, the web site runs but when I tried to run the API, its not working, I have created a portfolio folder: app: [api: route.js] , page.js.
当我在控制台运行 npm run dev
时,网站可以运行,但当我尝试运行 API 时,它不起作用。我已经创建了一个名为 portfolio
的文件夹,其中包含:app
(其中包含 api: route.js
和 page.js
)
route.js:
import { OpenAIClient, AzureKeyCredential } from '@azure/openai';
import { NextResponse } from 'next/server';
const endpoint = process.env.AZURE_OPENAI_ENDPOINT;
const apiKey