json-server icon indicating copy to clipboard operation
json-server copied to clipboard

Serving local json files

Open glosrob opened this issue 7 years ago • 1 comments

Hi,

I cannot seem to get the server to return me some static JSON files (I get a CORS error).

Server is setup as:

/server/

survey.json

/server/public/

example.json`

I start the server with json-server --watch survey.json --static public

The calls to the watched file work fine, but calls to example.json do not.

$.get('http://localhost:3000/public/example.json', function () {
    debugger;
});

Any ideas what I am doing wrong here?

glosrob avatar Mar 28 '18 12:03 glosrob