File tree Expand file tree Collapse file tree 6 files changed +22
-5
lines changed
Expand file tree Collapse file tree 6 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 22from fastapi import Request
33from fastapi .templating import Jinja2Templates
44
5- from routes import email
6- from routes import contact
7- from routes import company
5+ from routes . v1 import email
6+ from routes . v1 import contact
7+ from routes . v1 import company
88
99app = FastAPI ()
1010app .include_router (email .router )
Original file line number Diff line number Diff line change @@ -24,6 +24,21 @@ payment. The Organization makes the payment and a payment record is saved in the
2424 - create .env file and add the keys for env-example
2525 - alembic upgrade head (to migrate)
2626 - uvicorn app: app --reload (to run server)
27+ - /docs - to view available endpoints
28+
29+ # Endpoints - v1 (Version 1)
30+
31+ Contact
32+ - /api/v1/contacts/ - POST - Create a Contact
33+ - /api/v1/contact/<email>/ - GET email by contact
34+
35+ Company
36+ - /api/v1/companies/ - POST - Create a Company/Organization
37+ - /api/v1/company/<company-name>/ - GET - Get company by Name
38+
39+ Email
40+ - /api/v1/email/send/ - POST - Send an email
41+
2742
2843# External Integrations
2944
Original file line number Diff line number Diff line change 1010from crud import company as _company
1111
1212router = APIRouter (
13+ prefix = '/api/v1' ,
1314 tags = ["company" ],
1415 responses = {404 : {"description" : "Not found" }},
1516)
Original file line number Diff line number Diff line change 1111from crud import company as _company
1212
1313router = APIRouter (
14+ prefix = '/api/v1' ,
1415 tags = ["contact" ],
1516 responses = {404 : {"description" : "Not found" }},
1617)
Original file line number Diff line number Diff line change 1515from dependencies .dependencies import get_db
1616
1717router = APIRouter (
18- prefix = "/email" ,
18+ prefix = '/api/v1' ,
1919 tags = ["email" ],
2020 responses = {404 : {"description" : "Not found" }},
2121)
2222
2323
24- @router .post ("/send/" )
24+ @router .post ("/email/ send/" )
2525async def send_email (request : Request , db : Session = Depends (get_db )):
2626 try :
2727 data = await request .json ()
You can’t perform that action at this time.
0 commit comments