File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,4 +70,25 @@ https://chatgpt.com/share/680cb4dd-78b0-8000-9039-0861c2b0e24c
7070
7171## Local Setup steps
7272
73- ` pip install -e .[dev] `
73+ ` pip install -e .[dev] `
74+
75+ ## Running the FastAPI Application Locally
76+
77+ To run the FastAPI application locally, follow these steps:`
78+
79+ 1 . ** Run the Application** :
80+ Navigate to the ` src ` directory and start the FastAPI application using:
81+ ``` bash
82+ uvicorn app:app --reload
83+ ```
84+
85+ 1 . ** Access the Application** :
86+ Open your browser and navigate to:
87+ ```
88+ http://127.0.0.1:8000
89+ ```
90+
91+ 1 . ** API Documentation** :
92+ FastAPI provides interactive API documentation. You can access it at:
93+ - Swagger UI: [ http://127.0.0.1:8000/docs ] ( http://127.0.0.1:8000/docs )
94+ - ReDoc: [ http://127.0.0.1:8000/redoc ] ( http://127.0.0.1:8000/redoc )
Original file line number Diff line number Diff line change 1+ from fastapi import FastAPI
2+
3+ app = FastAPI ()
4+
5+ @app .get ("/hello" )
6+ def hello_world ():
7+ return {"message" : "Hello, World!" }
Original file line number Diff line number Diff line change 1+ from fastapi .testclient import TestClient
2+ from src .app import app
3+
4+ client = TestClient (app )
5+
6+ def test_hello_world ():
7+ response = client .get ("/hello" )
8+ assert response .status_code == 200
9+ assert response .json () == {"message" : "Hello, World!" }
You can’t perform that action at this time.
0 commit comments