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

Axios baseURL is ignored #98

Closed
csabasulyok opened this issue Oct 19, 2021 · 1 comment
Closed

Axios baseURL is ignored #98

csabasulyok opened this issue Oct 19, 2021 · 1 comment

Comments

@csabasulyok
Copy link

Description

When using Axios' baseURL property (as seen in this example), baseURL is ignored, and only the url suffix is shown in logs.

Proposal

When the url config is set to true, both baseURL and url should be concatenated, maybe demarcating the base with a different color, or providing an extra flag for not showing the base.

Example code

import axios from 'axios';
import * as AxiosLogger from 'axios-logger';

const instance = axios.create({
  baseURL: 'https://github.com',
});

instance.interceptors.request.use(AxiosLogger.requestLogger, AxiosLogger.errorLogger);
instance.get('/hg-pyun');
  • expected output: [Axios][Request] GET https://github.com/hg-pyun
  • actual output: [Axios][Request] GET /hg-pyun
@csabasulyok
Copy link
Author

Duplicate of #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant