Escriu per cercar…

REST

Un servidor web es pot configurar com un servidor de recursos que s'accedeixen mijançant un conjunt de funcions "externes" o endpoints (API)

S'ensenya a
Desenvolupament web en entorn servidorServidor webDAW-BIOLlenguatges de marques i sistemes de gestió d’informacióDades documentalsASIXProgramació orientada a objectesInterfície web amb FastAPIPYTHON

Entorn de treball

Crea un projecte amb Uv

ps
uv init python-rest
cd python-rest

El primer pas és instal·lar FastAPI.

ps
uv add "fastapi[standard]"

Primers passos

The app variable is the “instance” of the class FastAPI and will be the main point of interaction to create all your API.

python
main.py
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}

Estàs llegint una vista prèvia.

Inicia sessió amb Google per llegir la pàgina completa.

Inicia sessió amb Google

Amb qualsevol compte de Google. Només et demanarem que acceptis les condicions del servei.