Skip to content

baseURL doesn't work #41

@mahdisalehian

Description

@mahdisalehian

I used baseURL in react but it doesn't affect the url

//axios-order.js
import axios from 'redaxios';

const instance = axios.create({
    baseURL: 'http://something.com/api'
});

export default instance;



//login.js
import axios from './axios-order';
const url = '/auth/admin-login';
    const authData = {
        mobile: mobile,
        password: password
    };
    axios.post(url, authData)
        .then(response => JSON.parse(response.data))
        .catch(error => {
            console.log(error)
        })

i receive this :

index.js:168 POST http://localhost:3000/auth/admin-login 404 (Not Found)

Metadata

Metadata

Assignees

No one assigned

    Labels

    has fixA fix is PR'd or merged, but not yet released

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions