scalableminds / webknossos-connect

Connect webKnossos with existing datasets (BossDB, Neuroglancer Precomputed)
GNU Affero General Public License v3.0
0 stars 0 forks source link

fix from_json, extract routes to files #42

Closed jstriebel closed 5 years ago

jstriebel commented 5 years ago

This PR mainly extracts the routes into files, as the __main__.py grew too big, more routes are coming in the next PR. @fm3 What do you think about the file-structure?

Also, I noted a bug from the last PR, which I fixed here as well, see my comment at the code.

jstriebel commented 5 years ago

Also, I removed the add_dataset endpoint /api/<backend_name>/<organization_name>/<dataset_name>, which will be replaced by some logic on the upload route (POST on /data/datasets).

jstriebel commented 5 years ago

@fm3 Actually having something similar like the routes-files should be easy:

from .my_route import my_route
app.route("/bla/<param1>/<param2>", methods=["POST"])(my_route)

The problem here is that it's harder to see if the method's and the url's parameters match. That's why I would leave it like this for now.

fm3 commented 5 years ago

True, fine by me to leave it :)