✨ Add caching for icons with an image proxy

Fixes #307
This commit is contained in:
ajnart committed 2022-08-01 17:12:18 +02:00
1 parent b4bdf3737a
commit bc05038427
3 files changed
+19 -4

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import { NextApiRequest, NextApiResponse } from 'next';
export default async (req: NextApiRequest, res: NextApiResponse) => {
const url = decodeURIComponent(req.query.url as string);
const result = await fetch(url);
const body = await result.body;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
body.pipe(res);
};