Raxios is a wrapper of axios extending some functionallity of url pattern matching used in express library.
npm install --save raxios
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
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