gimme a fastapi usage example in python
- User
user: gimme a fastapi usage example in python
- Assistant
Certainly! Below is a simple example of how to create a FastAPI application in Python. This example will include a basic API with a couple of endpoints: one for getting a welcome message and another for performing simple addition.
Prerequisites
Make sure you have FastAPI and an ASGI server (like
uvicorn) installed. You can do this using pip:bashpip install fastapi uvicorn