Skip to content
Snippets Groups Projects
README.md 1.11 KiB
Newer Older
  • Learn to ignore specific revisions
  • David Trattnig's avatar
    David Trattnig committed
    # Engine API Server
    
    David Trattnig's avatar
    David Trattnig committed
    
    ## Overview
    
    
    David Trattnig's avatar
    David Trattnig committed
    The Project serves the Engine API and handles state management of multiple Engine instances.
    
    This project is based on a swagger-enabled Flask server using an *API First* approach. It also uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask.
    
    David Trattnig's avatar
    David Trattnig committed
    
    ## Requirements
    
    David Trattnig's avatar
    David Trattnig committed
    
    
    David Trattnig's avatar
    David Trattnig committed
    Python 3.7+
    
    David Trattnig's avatar
    David Trattnig committed
    
    
    David Trattnig's avatar
    David Trattnig committed
    ## Getting started
    
    
    David Trattnig's avatar
    David Trattnig committed
    To run the server, please execute the following from the root directory:
    
    ```
    pip install -r requirements.txt
    python -m src
    ```
    
    
    David Trattnig's avatar
    David Trattnig committed
    this runs the API in an local development server. You can access the interactive documentation here:
    
    David Trattnig's avatar
    David Trattnig committed
    
    ```
    
    David Trattnig's avatar
    David Trattnig committed
    http://localhost:8008/api/v1/ui/
    
    David Trattnig's avatar
    David Trattnig committed
    ```
    
    
    David Trattnig's avatar
    David Trattnig committed
    Your OpenAPI definition lives here:
    
    David Trattnig's avatar
    David Trattnig committed
    
    ```
    
    David Trattnig's avatar
    David Trattnig committed
    http://localhost:8008/api/v1/openapi.json
    
    David Trattnig's avatar
    David Trattnig committed
    ```
    
    
    David Trattnig's avatar
    David Trattnig committed
    ## Testing
    
    
    David Trattnig's avatar
    David Trattnig committed
    To launch the integration tests, use tox:
    ```
    sudo pip install tox
    tox
    ```
    
    
    David Trattnig's avatar
    David Trattnig committed
    > Note, there are currently issues with the test environment, hence this doesn't work properly.
    
    
    David Trattnig's avatar
    David Trattnig committed
    ## Running with Docker
    
    To run the server on a Docker container, please execute the following from the root directory:
    
    ```bash
    # building the image
    docker build -t src .
    
    # starting up a container
    docker run -p 8008:8008 src
    
    David Trattnig's avatar
    David Trattnig committed
    ```