Skip to content

alan-maldonado/raxios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

raxios

npm npm

Raxios is a wrapper of axios extending some functionallity of url pattern matching used in express library.

Installation

npm install --save raxios

Usage

import raxios from 'raxios'

raxios.get('http://myapi.com/:foo/search', {
  urlParams: {
    foo: 'bar'
  }
}).then(res => console.log(res.data))

This will produce a request to http://myapi.com/bar/search

Usage with query params

import raxios from 'raxios'

raxios.get('http://myapi.com/:foo/search', {
  urlParams: {
    foo: 'bar'
  },
  params: {
    q: 'soccer'
  }
}).then(res => console.log(res.data))

This will produce a request to http://myapi.com/bar/search?q=soccer

About

Axios library with support of url params match

Resources

License

Stars

Watchers

Forks

Packages

No packages published