INNER CODE UNIT · Python
serve_frontend
evolution-foundation/evo-nexus · dashboard/backend/app.py:1051
def serve_frontend(path):
full = FRONTEND_DIST / path
if full.is_file():
return send_from_directory(str(FRONTEND_DIST), path)
index = FRONTEND_DIST / "index.html"
if index.exists():
return send_from_directory(str(FRONTEND_DIST), "index.html")
return {"error": "Frontend not built. Run npm build in frontend/"}, 404
if __name__ == "__main__":
# Read port from workspace.yaml or env, fallback to 8080
port = int(os.environ.get("EVONEXUS_PORT", 8080))
try:
import yaml
config_path = WORKSPACE / "config" / "workspace.yaml"
if config_path.is_file():
with open(config_path, encoding="utf-8") as f: