Skip to main content

GET /

Returns a welcome message to confirm the API is running and accessible.

Authentication

No authentication required - this is a public endpoint.

Request

No parameters required.
curl http://127.0.0.1:8000/

Response

message
string
Welcome message from the API

Success Response (200 OK)

{
  "message": "Welcome to URL Shortener"
}

Use Cases

Use this endpoint as a simple connectivity test to verify the API is accessible and responding to requests.Unlike /health, this endpoint does not check database connectivity - it only confirms the web server is running.
Useful for service discovery tools and load balancers to verify the API endpoint is reachable.

Implementation Details

From main.py:72-74:
@app.get("/")
async def read_root():
    return {"message": "Welcome to URL Shortener"}
This endpoint does not interact with the database and returns immediately, making it very lightweight for connectivity checks.

Build docs developers (and LLMs) love