3.0.0 • Published 4 years ago

axios-api-versioning v3.0.0

Weekly downloads
218
License
MIT
Repository
github
Last release
4 years ago

axios-api-versioning

npm version Greenkeeper badge CircleCI

Add easy to manage api versioning to axios

Online Demo

Edit axios-api-versioning browser demo

Visit Online Demo

Quick Start

Install

npm install --save axios-api-versioning
yarn add axios-api-versioning

Example Usage

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 Support

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.

Documentation

You can visit the online docs here: https://weffe.github.io/axios-api-versioning

Example Projects

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

Changelog

You can view the changelog here.

Related Projects

License

MIT

3.0.0

4 years ago

2.1.0

5 years ago

2.1.0-alpha.0

5 years ago

2.0.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago