setup local hosting
This commit is contained in:
1 parent
25e65540e1
commit
63cfd936b5
9 files changed
+31
-22
No files matched your search
+1
-1
@@ -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
@@ -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")
|
||||
|
||||
|
||||
Reference in new issue
Block a user