0.0.1 • Published 4 years ago

axios-client-builder v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Contributors Forks Stargazers Issues MIT License LinkedIn

Getting Started

Installation

  1. npm i axios-client-builder

Usage

import { ClientBuilder } from 'axios-client-builder';

const client = new ClientBuilder({
    config: { baseURL: env.getUrl() }, // OPTIONAL Axios config object
})
    .addDefaultHeader(key, value)
    .addErrorHandling(statuses[], fn[])
    .addRequestLogging(logger) // Log requests and timing of requests
    .addErrorLogging(logger) // Log any request error that does not match axios validateStatus
    .addAuthorization(() => createAuthSignature()) // Add a dynamic auth on each request
    .build();

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Alex Burley - @burlzad - alex@askconsult.io

Project Link: https://github.com/alexburley/axios-client-builder(https://github.com/alexburley/axios-client-builder

Acknowledgments