This is a demo project that showcases how to use the Untypeable library with Wretch to make API requests to JsonPlaceholder and display the data on a webpage.
const externalApi = wretch(BASE_URL, { mode: "cors" }).errorType("json");
// TODO: support mutations (POST, PUT, PATCH, DELETE)
// Possible solution is to define each method as a separate router
export const fetcher = createTypeLevelClient<typeof fetcherRouter>(
async (path, input) => {
const res = externalApi.get(`${path}?${new URLSearchParams(input)}`);
Possible solution is to define each method as a separate router
https://api.github.com/jellydn/untypeable-wretch-demo/blob/19696540f54abd4aac3fedabc53e4e44611a76d8/src/api-client.ts#L28