Skip to content

Axios baseURL is ignored #98

@csabasulyok

Description

@csabasulyok

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions