mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 16:05:47 +01:00
10
src/pages/api/imageproxy.ts
Normal file
10
src/pages/api/imageproxy.ts
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user