20 lines
No EOL
504 B
TypeScript
20 lines
No EOL
504 B
TypeScript
import { NextResponse } from 'next/server'
|
|
|
|
export async function POST() {
|
|
try {
|
|
const response = await fetch('https://generalbots.online/directline/PROD-GeneralBots006/conversations', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
})
|
|
|
|
const data = await response.json()
|
|
return NextResponse.json(data)
|
|
} catch (error) {
|
|
return NextResponse.json(
|
|
{ error: 'Failed to create conversation' },
|
|
{ status: 500 }
|
|
)
|
|
}
|
|
} |