diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7818cc3 --- /dev/null +++ b/Makefile @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index f04b1ab..9e0193a 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file +make init +make test +make run +``` \ No newline at end of file diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/main.py b/app/main.py index d786432..d275f0e 100644 --- a/app/main.py +++ b/app/main.py @@ -5,4 +5,4 @@ app = FastAPI() @app.get("/") async def root(): - return {"message": "Hello World"} \ No newline at end of file + return {'message': 'Hello World'} \ No newline at end of file diff --git a/app/test.py b/app/test_main.py similarity index 76% rename from app/test.py rename to app/test_main.py index ddc013f..fd860bb 100644 --- a/app/test.py +++ b/app/test_main.py @@ -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"} diff --git a/requirements.txt b/requirements.txt index 6c9b0d6..7586a03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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