Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Quotable API Proxy

Small HTTP proxy to the Quotable API (https://api.quotable.io).

I built this due to some DNSSEC issues that the Quotable API is currently experiencing.

See this Github issue here for more information.

1
2
3
4
5
6
7
8
9
10
import { fetch } from "https://esm.town/v/std/fetch";
export default async function proxy(req: Request) {
const resp = await fetch(
"http://api.quotable.io/quotes/random?limit=1",
);
const json = await resp.json();
console.log(json);
return Response.json(json);
}
johndturn-quotableapiproxy.web.val.run
September 11, 2024