LuvDaSun / SkiffaGenerator

ISC License
3 stars 2 forks source link

Create a simple client api #82

Closed elmerbulthuis closed 4 months ago

elmerbulthuis commented 4 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");