LuvDaSun / SkiffaGenerator

ISC License
2 stars 2 forks source link

Create a simple client api #82

Closed elmerbulthuis closed 3 months ago

elmerbulthuis commented 3 months ago

instead of

// call the api
const result = await api.reverse(
  {
    contentType: "text/plain",
    value: () => "someValue",
  },
  {},
  { baseUrl: "http://url.url"}
);

// verify response status
if (result.status !== 200) {
  throw new Error("unexpected status");
}

// get the result
const resultValue = await result.value();

we should be able to do

const resultValue = await api.reverse("someValue");