Spaces:
Sleeping
Sleeping
File size: 936 Bytes
6257207 4d0359b 6257207 4d0359b 6257207 4d0359b 46e96d1 2a45442 4d0359b 6257207 4876a7d 4d0359b 4876a7d 6257207 ee50b6b 6257207 4d0359b 6257207 4d0359b ee50b6b | 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 | import sys
import os
# Add both parent directory and server directory to path
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
sys.path.insert(0, os.path.dirname(__file__))
from openenv.core.env_server import create_fastapi_app
from env import HealthcareEnvironment
from models import HealthcareAction, HealthcareObservation
app = create_fastapi_app(HealthcareEnvironment, HealthcareAction, HealthcareObservation)
from fastapi.responses import FileResponse
from fastapi.staticfiles import StaticFiles
# Mount static directory
STATIC_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), "static")
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
@app.get("/")
def read_root():
return FileResponse(os.path.join(STATIC_DIR, "index.html"))
def main():
import uvicorn
uvicorn.run("server.app:app", host="0.0.0.0", port=7860, reload=True)
if __name__ == '__main__':
main() |