Spaces:
Sleeping
Sleeping
Commit ·
51c67cb
1
Parent(s): 5ebef9c
test no static
Browse files- FastAPI/app/__pycache__/main.cpython-310.pyc +0 -0
- FastAPI/app/build/asset-manifest.json +8 -8
- FastAPI/app/build/index.html +1 -1
- FastAPI/app/build/static/js/{main.7fc23381.js → main.e4173142.js} +0 -0
- FastAPI/app/build/static/js/{main.7fc23381.js.LICENSE.txt → main.e4173142.js.LICENSE.txt} +0 -0
- FastAPI/app/build/static/js/{main.7fc23381.js.map → main.e4173142.js.map} +0 -0
- FastAPI/app/main.py +5 -25
- README.md +1 -1
- my-app/package.json +0 -1
FastAPI/app/__pycache__/main.cpython-310.pyc
CHANGED
|
Binary files a/FastAPI/app/__pycache__/main.cpython-310.pyc and b/FastAPI/app/__pycache__/main.cpython-310.pyc differ
|
|
|
FastAPI/app/build/asset-manifest.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
{
|
| 2 |
"files": {
|
| 3 |
-
"main.css": "/static/
|
| 4 |
-
"main.js": "/static/
|
| 5 |
-
"static/js/453.68693753.chunk.js": "/static/
|
| 6 |
-
"index.html": "/
|
| 7 |
-
"main.f855e6bc.css.map": "/static/
|
| 8 |
-
"main.
|
| 9 |
-
"453.68693753.chunk.js.map": "/static/
|
| 10 |
},
|
| 11 |
"entrypoints": [
|
| 12 |
"static/css/main.f855e6bc.css",
|
| 13 |
-
"static/js/main.
|
| 14 |
]
|
| 15 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"files": {
|
| 3 |
+
"main.css": "/static/css/main.f855e6bc.css",
|
| 4 |
+
"main.js": "/static/js/main.e4173142.js",
|
| 5 |
+
"static/js/453.68693753.chunk.js": "/static/js/453.68693753.chunk.js",
|
| 6 |
+
"index.html": "/index.html",
|
| 7 |
+
"main.f855e6bc.css.map": "/static/css/main.f855e6bc.css.map",
|
| 8 |
+
"main.e4173142.js.map": "/static/js/main.e4173142.js.map",
|
| 9 |
+
"453.68693753.chunk.js.map": "/static/js/453.68693753.chunk.js.map"
|
| 10 |
},
|
| 11 |
"entrypoints": [
|
| 12 |
"static/css/main.f855e6bc.css",
|
| 13 |
+
"static/js/main.e4173142.js"
|
| 14 |
]
|
| 15 |
}
|
FastAPI/app/build/index.html
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/
|
|
|
|
| 1 |
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.e4173142.js"></script><link href="/static/css/main.f855e6bc.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
FastAPI/app/build/static/js/{main.7fc23381.js → main.e4173142.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
FastAPI/app/build/static/js/{main.7fc23381.js.LICENSE.txt → main.e4173142.js.LICENSE.txt}
RENAMED
|
File without changes
|
FastAPI/app/build/static/js/{main.7fc23381.js.map → main.e4173142.js.map}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
FastAPI/app/main.py
CHANGED
|
@@ -1,32 +1,12 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
-
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
-
from fastapi.responses import RedirectResponse
|
| 4 |
from fastapi.staticfiles import StaticFiles
|
| 5 |
-
import
|
| 6 |
-
from pydantic import BaseModel
|
| 7 |
-
|
| 8 |
-
app = FastAPI()
|
| 9 |
-
|
| 10 |
-
app.add_middleware(
|
| 11 |
-
CORSMiddleware,
|
| 12 |
-
allow_origins=["*"],
|
| 13 |
-
allow_credentials=True,
|
| 14 |
-
allow_methods=["*"],
|
| 15 |
-
allow_headers=["*"],
|
| 16 |
-
)
|
| 17 |
|
| 18 |
|
| 19 |
-
|
| 20 |
-
message: str
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
-
def read_item(item: Item):
|
| 25 |
-
return {"Hello": f"World! {item.message} I love Laura"}
|
| 26 |
|
| 27 |
@app.get("/")
|
| 28 |
-
def
|
| 29 |
-
|
| 30 |
-
return RedirectResponse(url='/static/')
|
| 31 |
-
|
| 32 |
-
app.mount("/static", StaticFiles(directory="app/build", html=True), name="static")
|
|
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
|
|
|
| 2 |
from fastapi.staticfiles import StaticFiles
|
| 3 |
+
from fastapi.responses import FileResponse
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
+
app = FastAPI()
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
app.mount("/", StaticFiles(directory="app/build", html=True), name="static")
|
|
|
|
|
|
|
| 9 |
|
| 10 |
@app.get("/")
|
| 11 |
+
def index() -> FileResponse:
|
| 12 |
+
return FileResponse(path="/app/build/index.html", media_type="text/html")
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -6,7 +6,7 @@ colorTo: purple
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: apache-2.0
|
| 9 |
-
app_port:
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: apache-2.0
|
| 9 |
+
app_port: 8000
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
my-app/package.json
CHANGED
|
@@ -2,7 +2,6 @@
|
|
| 2 |
"name": "my-app",
|
| 3 |
"version": "0.1.0",
|
| 4 |
"private": true,
|
| 5 |
-
"homepage": "/static",
|
| 6 |
"dependencies": {
|
| 7 |
"@emotion/react": "^11.11.4",
|
| 8 |
"@emotion/styled": "^11.11.5",
|
|
|
|
| 2 |
"name": "my-app",
|
| 3 |
"version": "0.1.0",
|
| 4 |
"private": true,
|
|
|
|
| 5 |
"dependencies": {
|
| 6 |
"@emotion/react": "^11.11.4",
|
| 7 |
"@emotion/styled": "^11.11.5",
|