The DiffFusionServer.jl package provides a REST API for the DiffFusion.jl exposure simulation framework.
The server accepts HTTP requests with methods GET, POST, DELETE. The methods are used to query and modify an object repository.
The POST method is used to create objects via DiffFusion methods. Objects are labelled with an identifier (alias). Subsequent GET method requests retrieve the object. Requests with DELETE method allow deleting objects in the repository.
Details of requests are stored in the request header and the request body. The request body is interpreted as JSON format. Results from requests are stored in the response body. Results are also interpreted as JSON format.
A convenient way to run the DiffFusionServer
is by using Docker. A Docker image can be build locally or obtained from Docker Hub.
Download or clone the DiffFusionServer
source code and go to the docker
folder.
The image can be build via
docker build --pull --rm -t diff-fusion-server:latest .
A container can be started from the built image via
docker run --rm -it -p 2024:2024 diff-fusion-server:latest --port 2024
The server is listening on port 2024. If you can access the info page via browser then everything is set up.
Alternatively, you can pull a pre-build Docker image via
docker pull sschlenkrich/diff-fusion-server:latest
A container can be started from the pulled image via
docker run --rm -it -p 2024:2024 sschlenkrich/diff-fusion-server:latest --port 2024
The server is listening on port 2024. If you can access the info page via browser then everything is set up.
The usage of the API is illustrated by Python and Julia notebooks in the examples
folder.
The notebooks can be run via MyBinder.org or locally.
Additional examples are documented via the test suite.