Spaces:
Runtime error
Runtime error
File size: 752 Bytes
1768d92 efcff68 1768d92 efcff68 1768d92 efcff68 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
import os
import uvicorn
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
# from zeno import get_server, zeno
# create zeno object
# create second zeno object
# create fastapi for both zeno objects
# serve
# get_server()
def command_line():
app = FastAPI(title="Frontend API")
api_app = FastAPI(title="Backend API")
@api_app.get("/test")
def test():
return {"test": "test"}
app.mount("/api", api_app)
app.mount(
"/",
StaticFiles(
directory=os.path.dirname(os.path.realpath(__file__)) + "/frontend",
html=True,
),
name="base",
)
print("Running server")
uvicorn.run(app)
if __name__ == "__main__":
command_line()
|