Skip to content

Commit

Permalink
update ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
linglp committed Mar 13, 2024
1 parent 9ad465b commit eda99f2
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions apps/schematic/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,41 @@ This example uses the [Connexion](https://github.com/zalando/connexion) library
Python 3.5.2+

## Usage
To run the server, please execute the following from the root directory:

To run the server, please execute the following from folder `apps/schematic/api`:
```
pip3 install -r requirements.txt
python3 -m schematic_api
poetry shell
```

and open your browser to here:
To install dependencies:

```
http://localhost:8080/v1/ui/
poetry install
```

Your OpenAPI definition lives here:
And run schematic APIs:

```
http://localhost:8080/v1/openapi.json
python3 -m schematic-api
```
and open your browser to here:

To launch the integration tests, use tox:
```
sudo pip install tox
tox
http://127.0.0.1:7080/api/v1/ui/
```

## Running with Docker

To run the server on a Docker container, please execute the following from the root directory:

```bash
# Get the correct Python version
nx prepare schematic-api

# You only need to run this command one time
# This step adds SSL private key and certificate as environment variable in .env file
python3 apps/schematic/api/prepare_key_certificate.py

# building the image
docker build -t schematic_api .
nx build-image schematic-api

# starting up a container
docker run -p 8080:8080 schematic_api
nx serve-detach schematic-api
```

0 comments on commit eda99f2

Please sign in to comment.