coming soon..
Firstly, set compilerOptions.moduleResolution
be Bundler
to your project tsconfig.json
.
Easily define your client
import { ReiceRest, convertRouteParamsToUrlString } from "reice";
const apiConstants = {
"Say hello": "say/:text" as const,
};
export class MyClient extends ReiceRest {
async sayHello(text: string) {
return await this._axios.get(
convertRouteParamsToUrlString(apiConstants["Say hello"], { text }),
);
}
}
Now say 👋
import axios from "axios";
const myClient = new MyClient({
instance: axios.create(),
baseURL: "https://api.example.com",
});
await myClient.sayHello("hello");
We welcome contributions to enhance the functionality and usability of this utility. Feel free to submit issues for bug reports or feature requests, and create pull requests to suggest improvements or fixes.
This project is licensed under the MIT License - see the LICENSE file for details.