from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import HTMLResponse from app.api.v1 import rides, drivers, payments, users from app.websockets import routes as ws_routes app = FastAPI(title='RideShare API', version='1.0.0') app.add_middleware( CORSMiddleware, allow_origins=['*'], allow_methods=['*'], allow_headers=['*'], ) app.include_router(rides.router, prefix='/api/v1/rides', tags=['rides']) app.include_router(drivers.router, prefix='/api/v1/drivers', tags=['drivers']) app.include_router(payments.router, prefix='/api/v1/payments', tags=['payments']) app.include_router(users.router, prefix='/api/v1/users', tags=['users']) app.include_router(ws_routes.router) @app.get('/health') async def health(): return {'status': 'ok'} _LANDING_HTML = """ RideShare API
🚕

RideShare API

Live · v1.0.0

FastAPI backend powering the RideShare Android demo: rider auth, vehicle selection, driver matching, two-leg ride flow, and Stripe payment.

This service is consumed by the mobile app — there is no web UI here on purpose.

""" @app.get('/', response_class=HTMLResponse, include_in_schema=False) async def landing(): return _LANDING_HTML