Skip to content

Commit

Permalink
use fastapi vs flask
Browse files Browse the repository at this point in the history
  • Loading branch information
javierluraschi committed Jun 15, 2024
1 parent 13140e9 commit 1c40199
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/learn/genapps/apps/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ if st.button("Roll a dice"):
Web APIs are applications that are designed for other computer programs or services to interoperate with, if you wanted to enable other web apps to use your previous app, you would do this as follows:

```python
from flask import Flask
from fastapi import FastAPI
import random

app = Flask(__name__)
app = FastAPI()

@app.route('/')
def roll():
@app.get("/")
async def roll():
return f"You rolled a {random.randint(1, 6)}!"
```

0 comments on commit 1c40199

Please sign in to comment.