import axios from "axios"; import type { NextApiHandler } from "next"; const usersHandler: NextApiHandler = async (req, res) => { try { const response = await axios.get(`${process.env.PRISMA_API}/users`); res.status(response.status).json(response.data); } catch (e) { if (axios.isAxiosError(e)) { res.status(e.response?.status || 500).json(e.response?.data); } else { res.status(500).json({ message: "There was an error processing the request, please try again.", }); } } }; export default usersHandler;