-
-
Save vrajdesai78/f08dddbea39f03f0d298e7678a8f998f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import type { NextApiRequest, NextApiResponse } from 'next'; | |
const handler = async (req: NextApiRequest, res: NextApiResponse) => { | |
try { | |
const { data } = await axios.post( | |
'https://api.huddle01.com/api/v1/create-room', | |
{ | |
title: 'Huddle01-Test', | |
roomLock: false, | |
}, | |
{ | |
headers: { | |
'Content-Type': 'application/json', | |
'x-api-key': process.env.API_KEY, | |
}, | |
} | |
); | |
res.status(200).json(data); | |
} catch (error) { | |
res.status(500).json(error); | |
} | |
}; | |
export default handler; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment