Flask web application implementing legacy REST API for Slicer applications supporting only Midas_v1
.
URL | Description |
---|---|
https://slicer.kitware.com/ | Slicer legacy extensions catalog server hosted and maintained by Kitware. |
This section describes main files and directories available in this repository.
-
Flask web application served using uWSGI and expected to be proxied through Nginx.
-
This directory contains shell scripts for starting/stopping the flask web application and for setting up the relevant environments.
Name Description download-static-assets.sh
Download up-to-date static assets from KitwareMedical/slicer-extensions-webapp@slicer-kitware-com branch. start
Shell script for starting the download Flask web application. stop
Shell script for stopping the download Flask web application.
-
Create a virtual environment and install prerequisites
cd slicer-extensions-legacy-webapp python -m venv env ./env/bin/python -m pip install -r requirements.txt -r requirements-dev.txt
-
Download up-to-date static assets from KitwareMedical/slicer-extensions-webapp@slicer-kitware-com branch.
./bin/download-static-assets.sh
-
Setup the startup environment
echo "export SLICER_EXTENSIONS_LEGACY_WEBAPP_DEBUG=True" >> ./bin/.start_environment
-
Start the server
./bin/start
To simultaneously develop the web application frontend and the REST API implemented in the Flask application, consider the following steps:
-
Start the development server associated with slicer-extensions-webapp
git clone [email protected]:KitwareMedical/slicer-extensions-webapp cd slicer-extensions-webapp yarn install yarn serve
Keep track of the development server URL. For example,
http://localhost:8082
. -
Update the startup environment
echo "export FLASK_ENV=development" >> ./bin/.start_environment echo "export SLICER_EXTENSIONS_WEBAPP_URL=http://localhost:8082" >> ./bin/.start_environment
-
Restart the server
./bin/stop ./bin/start
These variables may be exported in the file ./bin/.start_environment
to customize environment
associated with the ./bin/start
script.
Variable Name | Description | Default |
---|---|---|
FLASK_ENV |
Setting to development will proxy assets from SLICER_EXTENSIONS_WEBAPP_URL . Supported values are production or development . |
production |
UWSGI_HTTP_HOST |
Host associated with the uWSGI server running the Flask application. | 127.0.0.1 |
UWSGI_HTTP_PORT |
Port associated with the uWSGI server running the Flask application. | 53693 |
SLICER_EXTENSIONS_LEGACY_WEBAPP_DEBUG |
If True , show unhandled exceptions and reload server when code changes. For more details, see here. |
False |
SLICER_EXTENSIONS_LEGACY_WEBAPP_URL |
URL of the Slicer legacy extensions catalog application. | http://<UWSGI_HTTP_HOST>:<UWSGI_HTTP_PORT> |
SLICER_EXTENSIONS_WEBAPP_URL |
URL serving slicer-extensions-webapp used on FLASK_ENV is set to development . |
http://localhost:8080 |
The original implementation was based on the slicerpackages
and slicerappstore
midas plugins
associated with the midasplatform.
It is covered by the Apache License, Version 2.0: