37 lines
735 B
Markdown
37 lines
735 B
Markdown
|
# API template with Clean Architecture
|
||
|
|
||
|
This is a template for building APIs with Clean Architecture. It contains two examples of APIs built with FastAPI and Flask.
|
||
|
|
||
|
- `src` contains the source code.
|
||
|
|
||
|
|
||
|
## Prepare
|
||
|
|
||
|
```bash
|
||
|
make build network
|
||
|
```
|
||
|
|
||
|
## Run FastAPI
|
||
|
|
||
|
```bash
|
||
|
make api.fastapi.run
|
||
|
```
|
||
|
|
||
|
Now, you can test the API with the following command:
|
||
|
|
||
|
```bash
|
||
|
curl -X 'GET' 'http://localhost:8000/api/v1/documents/?appName=app_test&clientId=client_test' -H 'accept: application/json' | jq
|
||
|
```
|
||
|
|
||
|
## Run Flask
|
||
|
|
||
|
```bash
|
||
|
make api.flask.run
|
||
|
```
|
||
|
|
||
|
Now, you can test the API with the following command:
|
||
|
|
||
|
```bash
|
||
|
curl -X 'GET' 'http://localhost:5000/api/v1/documents/?appName=app_test&clientId=client_test' -H 'accept: application/json' | jq
|
||
|
```
|