From 1c40199396419801ad205344ee9c038d5be45f88 Mon Sep 17 00:00:00 2001 From: Javier Luraschi Date: Fri, 14 Jun 2024 23:24:16 -0700 Subject: [PATCH] use fastapi vs flask --- website/learn/genapps/apps/intro.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/learn/genapps/apps/intro.md b/website/learn/genapps/apps/intro.md index b35c872e..e235e654 100644 --- a/website/learn/genapps/apps/intro.md +++ b/website/learn/genapps/apps/intro.md @@ -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)}!" ```