import biteShipAPI from '../../core/api/biteShip'; export default async function handler(req, res) { const { body } = req.query; const parsedBody = JSON.parse(body); console.log(parsedBody); try { let result = await biteShipAPI('POST', '/v1/rates/couriers', parsedBody); console.log('ini result', result); if (result && result.data && result.data.data) { res.status(200).json(result.data.data); } else { res .status(500) .json({ error: 'Unexpected response structure from Biteship API' }); } } catch (error) { console.error('Error:', error); res.status(400).json({ error: error.message }); } }