Skip to content

EUCAIM/user-negotiations-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

Once you cloned your repository and entered the root dir, follow the next steps:

  1. Create a python virtual env for your application

python3 -m venv .env

  1. Activate the env

source .env/bin/activate

  1. Install the requirements
    pip install toml-to-requirements
    toml-to-req --toml-file src/pyproject.toml --output requirements.txt
    pip install -r requirements.txt

Execution

Once the web server has been setup (see section Setup) follow the next steps to run it:

  1. Create your custom configuration file (see the Configuration section) - here we export the env var

export USER_NEGOTIATIONS_INFO_CONFIG=<path to config.json>

  1. Start the server
cd src
flask run -h <your host> -p <your port>

Configuration

The web service expects a json file with all the configuration parameters. The config_example.json file (found in the src/ dir) contains all the fields that can be configured for the application. There are two ways to pass your custom configuration: either create a file named config.json in the application's root dir (src/ in our case), or set the env variable USER_NEGOTIATIONS_INFO_CONFIG with the path of your custom configuration.

API

The OpenAPI 3.1 specification for this web service can be found in openapi.yml. If you prefer, you can visualize it with Swagger, locally, like this:

docker run -p 8080:8080 -e SWAGGER_JSON=/api/swagger.yml -v openapi.yml:/api/swagger.yml swaggerapi/swagger-ui

and then open localhost:8080 in a browser to see the live rendering of the YAML file.

If you want to call the service:

  export T=<your token>
  export URL=<server>:<port>/<root_path>
  export TYPE=IN_PROGRESS or AVAILABLE
  curl -v -H "Authorization: Bearer $T" "$URL/api/v1/datasets?type=${TYPE}"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors