developit / redaxios

The Axios API, as an 800 byte Fetch wrapper.

Home Page:https://npm.im/redaxios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

baseURL doesn't work

mahdisalehian opened this issue · comments

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)

This has already been noted and a fix has been provided at #20

Yep yep - apologies for the slow release, I got stuck refactoring interceptors and then the work week ended.

Update: version 0.3.0 is published.