more boilerplate

main
Philipp Rothmann 2022-03-02 16:22:11 +01:00
parent a35d70412c
commit 1577ab18bc
6 changed files with 29 additions and 10 deletions

11
Makefile 100644
View File

@ -0,0 +1,11 @@
init:
python3 -m venv env
. ./env/bin/activate
pip3 install -r requirements.txt
run:
./env/bin/uvicorn app.main:app --reload
test:
./env/bin/pytest app

View File

@ -7,11 +7,7 @@ does what nobody else want's to do.
### Getting Started
```
python3 -m venv env
. ./env/bin/activate
pip3 install -r requirements.txt
./env/bin/uvicorn app.main:app --reload
```
pip freeze -l > requirements.txt
make init
make test
make run
```

0
app/__init__.py 100644
View File

View File

@ -5,4 +5,4 @@ app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
return {'message': 'Hello World'}

View File

@ -8,4 +8,4 @@ client = TestClient(app)
def test_read_main():
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"msg": "Hello World"}
assert response.json() == {"message": "Hello World"}

View File

@ -1,11 +1,23 @@
anyio==3.5.0
asgiref==3.5.0
attrs==21.4.0
certifi==2021.10.8
charset-normalizer==2.0.12
click==8.0.4
fastapi==0.74.1
h11==0.13.0
idna==3.3
iniconfig==1.1.1
packaging==21.3
pluggy==1.0.0
py==1.11.0
pydantic==1.9.0
pyparsing==3.0.7
pytest==7.0.1
requests==2.27.1
sniffio==1.2.0
starlette==0.17.1
tomli==2.0.1
typing_extensions==4.1.1
urllib3==1.26.8
uvicorn==0.17.5