Log an error, remove extra comment

This commit is contained in:
Austin Chen 2022-10-12 09:45:58 -07:00
parent 7434bf01c0
commit 86e418cca8

View File

@ -18,7 +18,6 @@ export default async function route(req: NextApiRequest, res: NextApiResponse) {
methods: 'POST',
})
// const body = JSON.parse(req.body)
// Check that prompt and apiKey are included in the body
if (!req.body.prompt) {
res.status(400).json({ message: 'Missing prompt' })
@ -59,6 +58,7 @@ export default async function route(req: NextApiRequest, res: NextApiResponse) {
res.status(200).json({ url })
} catch (e) {
console.error(e)
res.status(500).json({ message: `Error running code: ${e}` })
}
}