Adds api versioning for axios
npm install axios-api-versioning


Add easy to manage api versioning to axios

npm
``bash`
npm install --save axios-api-versioning
yarn
`bash`
yarn add axios-api-versioning
`javascript
import axios from 'axios';
import { withVersioning, VersioningStrategy } from 'axios-api-versioning';
// create an axios instance with versioning
// and versioning config
const client = withVersioning(axios, {
apiVersion: '1.0.0',
versioningStrategy: VersioningStrategy.QueryString
});
client.get('http://example.com', {
// override default apiVersion
apiVersion: '2.0.2',
// override default versioningStrategy
versioningStrategy: VersioningStrategy.MediaType
})
`
TypeScript is supported! There's no need to install types for this package from the @types repository as they are provided by this package directly.
You can visit the online docs here: https://weffe.github.io/axios-api-versioning
There are 2 example projects showcasing the usage of axios-api-versioning`.
You can check them out here:
1. with-nodejs
2. with-react-typescript
You can view the changelog here.
- https://github.com/Microsoft/aspnet-api-versioning
MIT