setup local hosting

This commit is contained in:
ari committed 2022-01-04 23:27:23 -05:00
1 parent 25e65540e1
commit 63cfd936b5
9 files changed
+31 -22

No files matched your search

+1 -1
View File
@@ -43,5 +43,5 @@ clean:
run-local:
rm -f web
ln -s ../web/dist web
ln -s ../webapp/build web
USE_EXAMPLE_REPO=1 uvicorn src.app:app
+11 -8
View File
@@ -7,14 +7,17 @@ from .routes import ping, automations
def make_app(automation_mgr: AutomationManager) -> FastAPI:
app = FastAPI()
# app.mount(
# "/web",
# StaticFiles(
# directory=ROOT_FOLDER / "web",
# html=True,
# ),
# name="web",
# )
if (ROOT_FOLDER / "web").exists():
app.mount(
"/web",
StaticFiles(
directory=ROOT_FOLDER / "web",
html=True,
),
name="web",
)
else:
print("WARN: could not find web folder")
app.include_router(ping.router, prefix="/ping")
app.include_router(automations.make_automation_router(automation_mgr), prefix="/automations")
+1 -1
View File
@@ -1 +1 @@
../web/dist
../webapp/build