Follow

storing json on my own webserver?

I can't remember seeing anything in any of the help or tutorials, but I was wondering if I can make the "published.json" file available on the web on my own server and point the story map at it? I tried to do it by simply replacing the googledrive section of the url with my own url to the json but was not successful.

http://cdn.knightlab.com/libs/storymapjs/latest/embed/?url=http://labs.wolfsonian.org/KnightLabStoryMap/public/DanceOfDeath03/published.json

thanks

Derek

Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Kyle Harris

    I also have this problem

  • 1
    Avatar
    Knight Lab

    while this is technically possible, it generally doesn't work as readily as you might wish. 

    Javascript requests for JSON files are subject to CORS checks by browsers. That is, before requesting the file, the browser will check the server's "Access-Control-Allow-Origin" header for the file.  If there's no such header set, then the browser will only fetch the file if it comes from the same server (domain name) as the one which served the page which is making the request.  Since your JSON isn't on "cdn.knightlab.com", this doesn't work.

    StoryMapJS no longer uses Google Drive, for a variety of reasons, but when it did, Drive's CORS settings were compatible with this use case.

    If you want to host your own JSON, it may be simpler to also create the StoryMap itself on your own page. Some information about that is at https://storymap.knightlab.com/advanced/ 

    Alternatively, you or your server administrator can configure the web server (in the original post, 'labs.wolfisonian.org') to return a compatible 'Access-Control-Allow-Origin' header , such as 'cdn.knightlab.com' or a pattern which matches that.

     

     

Please sign in to leave a comment.
Powered by Zendesk