From 5014dbabac34ee156994569adaa5d214e897c3cc Mon Sep 17 00:00:00 2001 From: Roger Bonin Date: Tue, 13 Feb 2024 21:12:59 +0100 Subject: [PATCH] add initial source --- README.md | 6 ++++-- {src => app}/__init__.py | 2 +- {src => app}/main.py | 0 tests/test.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) rename {src => app}/__init__.py (72%) rename {src => app}/main.py (100%) diff --git a/README.md b/README.md index c7cf036..7028155 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ python -m pip install -r requirements.txt ## test / lint ```bash -pylint src +pylint app ``` ```bash @@ -28,7 +28,9 @@ pytest tests/test.py ## run server ```bash -uvicorn src.main:app --reload +uvicorn app.main:app --reload ``` http://127.0.0.1:8000/items/5?q=somequery + +http://127.0.0.1:8000/docs diff --git a/src/__init__.py b/app/__init__.py similarity index 72% rename from src/__init__.py rename to app/__init__.py index 95f0fe1..38ee079 100644 --- a/src/__init__.py +++ b/app/__init__.py @@ -1,7 +1,7 @@ """ Main module for the application. """ -from src.main import app +from app.main import app __all__ = [ "app" diff --git a/src/main.py b/app/main.py similarity index 100% rename from src/main.py rename to app/main.py diff --git a/tests/test.py b/tests/test.py index 9785a3d..e344d23 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1,7 +1,7 @@ from fastapi.testclient import TestClient # from .src import app -from src.main import app +from app.main import app client = TestClient(app)