Spaces:
Sleeping
Sleeping
Download app/main.py from vishalharkal/openenv-claw1: direct link, hf CLI and curl.
- Browser
- Download file 878 Bytes
-
https://huggingface.co/spaces/vishalharkal/openenv-claw1/resolve/main/app/main.py
- Command line
-
hf download hf://spaces/vishalharkal/openenv-claw1/app/main.py
-
curl -L -o main.py https://huggingface.co/spaces/vishalharkal/openenv-claw1/resolve/main/app/main.py
878 Bytes
| from __future__ import annotations | |
| from pathlib import Path | |
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from fastapi.responses import RedirectResponse | |
| from fastapi.staticfiles import StaticFiles | |
| from app.routes import router | |
| app = FastAPI( | |
| title="Last-Mile Delivery Optimization Environment", | |
| version="1.0.0", | |
| description="OpenEnv-compatible environment for grid-based last-mile delivery optimization.", | |
| ) | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=False, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| STATIC_DIR = Path(__file__).resolve().parent / "static" | |
| app.mount("/static", StaticFiles(directory=str(STATIC_DIR)), name="static") | |
| def results_ui() -> RedirectResponse: | |
| return RedirectResponse(url="/static/results.html") | |
| app.include_router(router) | |