Skip to content

Instantly share code, notes, and snippets.

Last active May 12, 2023 09:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save SidJain1412/38554db19f4fa8e713b25c4fb0a7ebd3 to your computer and use it in GitHub Desktop.
Basic FastAPI app
# Run using `uvicorn simple_app:app --reload`
# Visit for documentation and testing the API
from fastapi import FastAPI, Query
app = FastAPI(
title="FastAPI Example",
description="### Hello world",
@app.get("/echo/", tags=["APIs"], response_model=str)
def echo(input_value: str = Query(..., max_length=20)):
return input_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment