Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baseUrl config parameter #137

Closed
nickuraltsev opened this issue Oct 28, 2015 · 8 comments · Fixed by #160
Closed

baseUrl config parameter #137

nickuraltsev opened this issue Oct 28, 2015 · 8 comments · Fixed by #160

Comments

@nickuraltsev
Copy link
Member

What do you think about adding baseUrl config parameter?

var github = axios.create({baseUrl: 'https://api.github.com/'});
github.get('/users/nickuraltsev');

I'd be happy to create a PR for this.

@ruscoder
Copy link

ruscoder commented Nov 5, 2015

+1

@iam4x
Copy link

iam4x commented Nov 10, 2015

I agree with @nickuraltsev, I've made a little wrapper around axios for my own usage:

https://github.com/iam4x/isomorphic-flux-boilerplate/blob/master/shared%2Fapi-client.js

@JoshZA
Copy link
Contributor

JoshZA commented Nov 21, 2015

👍

@mzabriskie
Copy link
Member

@nickuraltsev happy to accept a PR

@nickuraltsev
Copy link
Member Author

Great, I'll create a PR soon.

@diessica
Copy link

diessica commented Dec 3, 2015

Awesome!

@ghost
Copy link

ghost commented Dec 4, 2015

is that why this doesn't work:
axios('/user')

and this does?
axios('http://localhost:3000/user')

@nickuraltsev
Copy link
Member Author

@SkateFreak Do you have this issue when using axios in the browser or node.js? If the former, relative URLs should work fine as far as I know.

@axios axios locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants