Spaces:
Sleeping
Sleeping
init
Browse files- .vscode/launch.json +19 -0
- Dockerfile +15 -0
- app/__pycache__/main.cpython-39.pyc +0 -0
- app/main.py +7 -0
- requirements.txt +1 -0
.vscode/launch.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
// 使用 IntelliSense 了解相关属性。
|
3 |
+
// 悬停以查看现有属性的描述。
|
4 |
+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
5 |
+
"version": "0.2.0",
|
6 |
+
"configurations": [
|
7 |
+
{
|
8 |
+
"name": "Python: FastAPI",
|
9 |
+
"type": "python",
|
10 |
+
"request": "launch",
|
11 |
+
"module": "uvicorn",
|
12 |
+
"args": [
|
13 |
+
"app.main:app"
|
14 |
+
],
|
15 |
+
"jinja": true,
|
16 |
+
"justMyCode": true
|
17 |
+
}
|
18 |
+
]
|
19 |
+
}
|
Dockerfile
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9
|
2 |
+
|
3 |
+
WORKDIR /code
|
4 |
+
|
5 |
+
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
6 |
+
|
7 |
+
COPY ./requirements.txt /code/requirements.txt
|
8 |
+
|
9 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
COPY . .
|
14 |
+
|
15 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
app/__pycache__/main.cpython-39.pyc
ADDED
Binary file (354 Bytes). View file
|
|
app/main.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
|
3 |
+
app = FastAPI()
|
4 |
+
|
5 |
+
@app.get("/")
|
6 |
+
async def root():
|
7 |
+
return {"message": "Hello World"}
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fastapi
|