diff --git a/README.md b/README.md index 3cba598..c168286 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ You can create a new instance of axios with a custom config. ```js var instance = axios.create({ + baseURL: 'https://some-domain.com/api/', timeout: 1000, headers: {'X-Custom-Header': 'foobar'} }); @@ -165,6 +166,11 @@ These are the available config options for making requests. Only the `url` is re { // `url` is the server URL that will be used for the request url: '/user', + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', // `method` is the request method to be used when making the request method: 'get', // default