neuroanatomy / microdraw

Collaborative vectorial annotation tool for ultra high resolution data
https://microdraw.pasteur.fr
GNU General Public License v3.0
23 stars 8 forks source link

avoid waiting to be blocked by cors when loading a dataset in localhost #75

Closed ntraut closed 2 years ago

ntraut commented 2 years ago

When we load a dataset in localhost, microdraw first tries to load the JSON from the app, which takes some time, and then after the fail it tries to download from the server. The app request is blocked by CORS so it is useless to wait, and in case it would not we could get an error as the json has to be modified by the server for a cross domain request. By downloading directly we get:

{
  "pixelsPerMeter": 1000000, 
  "tileSources": [
    "vervet/vervet.dzi"
  ]
}

By downloading with the server we get:

{
  "pixelsPerMeter": 1000000, 
  "tileSources": [
    "http://localhost:3000/getTile?source=https://microdraw.pasteur.fr/vervet/vervet.dzi"
  ]
}

Only the second will work when in localhost, as the dzi is not part of the local version.

katjaq commented 2 years ago

awesome! thanks for catching this! 🚀