@mild-ts/rest-client
Lightweight REST client helper function wrapping with type and Axios
Introduction
Lightweight REST client helper function with basic type support and Axios wrapper. However, if you need more type-safety, we recommend considering untypeable.
Alternatively, if you have control over both the server and client types, options like tRPC or GraphQL are great choices. So go ahead and choose the option that works best for your needs!
Installation
npm i @mild-ts/rest-client
Examples
import { RestClient } from '@mild-ts/rest-client';
async function main() {
const client = new RestClient();
const res = await client.request('GET https://jsonplaceholder.typicode.com/posts/{postId}/comments', {
params: {
postId: 1,
},
});
console.log(res.data);
}
main();
API
to be add later