Skip to content

Commit a293219

Browse files
author
Rui Zhu
committed
:wMerge branch 'main' into develop
2 parents 25e3544 + a6a2ce5 commit a293219

3 files changed

Lines changed: 457 additions & 416 deletions

File tree

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The unit tests can be run through pytest with
5252
poetry run pytest
5353
```
5454

55+
5556
## Building Docs
5657

5758
The API uses the sphinx documentation formation. To build the documentation, first [install sphinx](https://www.sphinx-doc.org/en/master/usage/installation.html).
@@ -62,3 +63,31 @@ Then,
6263
cd docs
6364
make build
6465
```
66+
67+
## Running
68+
69+
When the API is running, the following pages can be used to play with the endpoint
70+
71+
Visit the redoc page at http://127.0.0.1:8080/redoc
72+
73+
Visit the swagger page at http://127.0.0.1:8080/docs
74+
75+
76+
The API can be run locally when developing. To run,
77+
78+
### For local Development
79+
80+
#### Non-Docker
81+
82+
```bash
83+
poetry install
84+
poetry run uvicorn kwg_api.main:app --reload --port 80
85+
```
86+
87+
### With Docker
88+
89+
The API can also be run using the `docker-compose.dev.yaml` file with
90+
91+
```commandline
92+
docker-compose -f docker-compose.dev.yaml up
93+
```

kwg_api/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from kwg_api.api.node_negotiator import NodeNegotiator
99
from kwg_api.lib.prefix_builder import PrefixBuilder
1010

11-
app = FastAPI(title="KnowWhereGraph API", version="1.0.0")
1211
logging.basicConfig(level=logging.INFO)
13-
12+
app = FastAPI(title="KnowWhereGraph API", version="1.0.0")
13+
Instrumentator().instrument(app).expose(app)
1414

1515
@app.get(
1616
"/lod/ontology/{resource_id}",

0 commit comments

Comments
 (0)