1
2
3
4
5
6
7
8
9
10
import { fetch } from "https://esm.town/v/std/fetch";
export const handlePost = async (req: express.Request, res: express.Response) => {
const { url = "http://example.com", method = "GET", headers = {} } = req.body;
const resp = await fetch(url, {
redirect: "follow",
});
const text = await resp.text();
res.send(text);
};