diff --git a/src/api.ts b/src/api.ts index 426e55d..8c1b36b 100644 --- a/src/api.ts +++ b/src/api.ts @@ -140,4 +140,22 @@ router.post('/nft-claimer/mint', async (req, res) => { } }); +router.get('/proxy/:url', async (req, res) => { + const { url } = req.params; + + try { + const response = await fetch(url); + + return res.json(await response.json()); + } catch (e: any) { + capture(e); + res.status(500).json({ + error: { + code: 500, + message: 'failed to fetch URL' + } + }); + } +}); + export default router;