Skip to content

Commit 3707dd2

Browse files
committed
Load .env config
1 parent d52bd6e commit 3707dd2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from fastapi import FastAPI
2+
from dotenv import dotenv_values
3+
config = dotenv_values(".env")
24

35
app = FastAPI()
46

5-
67
@app.get("/")
78
async def root():
89
return {"message": "Hello World"}

0 commit comments

Comments
 (0)