Static GitHub Issues

[2006] How to get data from local json file using actions and axios.get()?

prev: SSR render catch ?
next: Accessing the store from an external file

I wrote Action, that should get data from db.json file. But I get: "xhr.js:178 GET http://localhost:8083/data/db.json 404 (Not Found)". Why is it, if my path is correct (db.json is in the same folder)? In profileActions.js:

import axios from "axios";
var customData = require('./db.json');

export function fetchUsers(){
    return function(dispatch){
        axios.get('./db.json')
            .then((response) => {
                dispatch({type:'FETCH_USERS_FULFILLED', payload:response.data});
            })
            .catch((err) => {
                dispatch({type:'FETCH_USERS_REJECTED', payload:err});
            })
    }
}
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1782">#c1782</a>)</em></sub></div>