From axios docs you have baseURL and url
baseURL
will be prepended to url
when making requests. So you can define baseURL
as http://127.0.0.1:8000
and make your requests to /url
// `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/',