I using list from json on my page. I work on localhost, then push to server. Elemets tree looks like:
/
|--> about/
| |--> about.html
| |--> about.js
| |--> list.json // first try
|--> smth/
|--> components/
|--> index.html
|--> style.sass
|--> list.json
I'm not able to reach the list.json
file.
I tried using both ./about/list.json
and about/list.json
, having list.json
file in the about
directory.
Then I tried with list.json
in the root, I used list.json
.
So I have 2 different errors:
When list.json
is in about/
dir - on localhost
it works fine, but on server I have 404 Error. This is the code I use:
$http.get('./app/list.json').then(function (res) {
var goods = res.data;
};
When list.json
is in root dir the server returns index.html
page..
$http.get('list.json').then(function (res) {
var goods = res.data;
};
What's wrong?
.json
file. What happens if you try to reach it from the browser? – rpadovani Aug 7 at 15:24.json
files – rpadovani Aug 7 at 15:32