Spaces:
Sleeping
Sleeping
gitignore and test of secrets
Browse files- .gitignore +36 -0
- app.py +3 -1
.gitignore
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# Byte-compiled / optimized / DLL files
|
3 |
+
__pycache__/
|
4 |
+
*.py[cod]
|
5 |
+
*$py.class
|
6 |
+
|
7 |
+
# C extensions
|
8 |
+
*.so
|
9 |
+
|
10 |
+
# Distribution / packaging
|
11 |
+
.Python
|
12 |
+
env/
|
13 |
+
venv/
|
14 |
+
ENV/
|
15 |
+
env.bak/
|
16 |
+
venv.bak/
|
17 |
+
*.egg
|
18 |
+
*.egg-info/
|
19 |
+
dist/
|
20 |
+
build/
|
21 |
+
*.pyc
|
22 |
+
|
23 |
+
# Flask specific
|
24 |
+
instance/
|
25 |
+
.webassets-cache
|
26 |
+
|
27 |
+
# Pytest
|
28 |
+
.cache
|
29 |
+
|
30 |
+
# mypy
|
31 |
+
.mypy_cache/
|
32 |
+
.dmypy.json
|
33 |
+
dmypy.json
|
34 |
+
|
35 |
+
# Pyre type checker
|
36 |
+
.pyre/
|
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
from fastapi import FastAPI
|
|
|
2 |
|
3 |
app = FastAPI()
|
|
|
4 |
|
5 |
@app.get("/")
|
6 |
def greet_json():
|
7 |
-
return {"Hello": "World!"}
|
8 |
|
|
|
1 |
from fastapi import FastAPI
|
2 |
+
from os import getenv
|
3 |
|
4 |
app = FastAPI()
|
5 |
+
MY_KEY = getenv("MY_KEY")
|
6 |
|
7 |
@app.get("/")
|
8 |
def greet_json():
|
9 |
+
return {"Hello": "World! My key is: " + MY_KEY}
|
10 |
|