Vai al contenuto principale
ProdottiStrumenti desktopTASTECADVisualizzazione disegniTASTEFILESGestione fileTASTEFTPTrasferimento fileTASTESSHSpazio di lavoro remotoTASTEZIPCompressione ed estrazioneStrumenti per sviluppatoriTASTECODEAmbiente di sviluppo integrato per RustTASTESTUDIOAmbiente integrato di sviluppo e testTASTEETLIntegrazione dati (ETL)ServerTASTEREMOTEServer di desktop remotoTASTEGEOServer geospazialeTASTEMAILSpazio di lavoro emailIniziaDownloadDocumentazioneAcquistaTutti i prodotti
Marketplace
Notizie
TecnologiaNotizieNotizie di sviluppo di oggiDocumentazioneLinguaggi di programmazioneRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFramework frontend webNext.jsReactVue.js · NuxtSvelteKitAngularFramework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFramework per app e desktopTauriFlutterReact NativeElectronAlgoritmiBasi degli algoritmiAlgoritmi fondamentaliAlgoritmi avanzatiAlgoritmi pratici
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrinaGuida alla community
CollaboraTrasferimento tecnicoRealizzazione del sito webRealizzazione di app desktopPipeline di rilascio e pagamentoPartner commercialeContatti
ServiziDesktop remotoPacchetti di installazione su misura
TASTEDEV
Prodotti

Strumenti desktop

TASTECADApri con leggerezza anche i disegni più complessiTASTEFILESSolo i file che servono, alla massima velocitàTASTEFTPLa via più ordinata per i tuoi fileTASTESSHUn legame più solido tra te e i tuoi serverTASTEZIPComprimi più veloce, estrai più sicuro

Strumenti per sviluppatori

TASTECODEModifica, compila, esegui il debug e testa app Rust in un'unica finestraTASTESTUDIODalla modifica ai test remoti e alle correzioni IA approvateTASTEETLSposta i dati guardando i valori

Server

TASTEREMOTEUn desktop remoto che gira sul tuo serverTASTEGEOUn server geospaziale compatibile con GeoServer, ricostruito in RustTASTEMAILRiprendi il controllo della tua posta

Inizia

DownloadUltime versioni di ogni prodottoDocsCome usare ogni prodottoAcquistaAbbonamenti e licenze perpetueTutti i prodottiTutti i prodotti a colpo d’occhio
Tutti i prodotti
MarketplaceNotizie
Tecnologia

Notizie

Notizie di sviluppo di oggiAnnunci ufficiali su linguaggi, framework, GitHub e IADocumentazioneGuide a linguaggi, framework e algoritmi

Linguaggi di programmazione

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Framework

Framework frontend webNext.jsReactVue.js · NuxtSvelteKitAngular
Framework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Framework per app e desktopTauriFlutterReact NativeElectron

Algoritmi

Basi degli algoritmiAnalisi della complessità · Ordinamento · Ricerca · Strutture dati di base · Alberi e heapAlgoritmi fondamentaliVisita dei grafi · Cammini minimi e alberi ricoprenti · Programmazione dinamica · Algoritmi greedy · Divide et impera · BacktrackingAlgoritmi avanzatiAlgoritmi sulle stringhe · Matematica e teoria dei numeri · Manipolazione dei bit · Alberi di segmenti · Union-FindAlgoritmi praticiStrategia per colloqui di programmazione · Cache LRU · Rate limiting · Hashing consistente
Tutta la documentazione di sviluppo
Community
ProgettiScopri sviluppatori e lavoriLog di sviluppoDecisioni e lezioni appresePromptIstruzioni riutilizzabiliProblemi degli strumenti di IAProblemi e alternative di Claude, Codex, GeminiVetrinaRisultati completatiGuida alla communityCome sviluppiamo in modo aperto
Collabora
Trasferimento tecnicoApp native in Rust ed eguiRealizzazione del sito web10 lingue, account, documentazione e downloadRealizzazione di app desktopRust ed egui, senza WebViewPipeline di rilascio e pagamentoFirma, MSI, deb, rpm, AppImage, hashPartner commercialeConsigliaci e ricevi il 30%ContattiSviluppo, partnership e investimenti
Servizi
Desktop remotoRaggiungi il tuo computer dal browserPacchetti di installazione su misuraSolo il necessario, impostazioni precaricate
Acquista
IT
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Accedi
Accedi
TASTEDEV

Dai piccoli strumenti a uno sviluppo migliore.

support@tastedev.netSostieni TASTEDEV
ProdottiGamma di prodottiAcquistaDocsDownloadMarketplaceAssistenza
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrina
NormeInformativa sulla privacyTermini di servizioCondizioni di abbonamentoRimborsiLinee guida della community
AccountAccediRegistrati
Visitatori
Oggi
012345678901234567890123456789012345678901234567890123456789
Ieri
012345678901234567890123456789012345678901234567890123456789
Visualizzazioni totali
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
Società
GXSOFT
Rappresentante
CHOI YOUNG GU
Numero di registrazione
853-44-00368
Indirizzo
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefono
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsabile privacy
CHOI YOUNG GU

© 2026 TASTEDEVLe informazioni sui prodotti si basano su fonti di sviluppo verificate.Rilasciato · in miglioramento

Documentazione di FastAPI
FastAPI
Getting Started with FastAPIProject StructureCore ConceptsData and StateTestingDeployment
Discussioni

Guida a FastAPI · 1/6

Getting Started with FastAPI

Per ora questo capitolo è disponibile solo in inglese.

This chapter takes you from installing FastAPI to running your first API on the development server. Along the way you will look at the API documentation FastAPI generates for you and set up your editor.

Prerequisites

FastAPI is a Python library, so you need Python installed first. Because FastAPI leans heavily on type hints, use a recent Python release within the range the official documentation supports. Check your version in a terminal:

python --version
# On Windows, if the python command is missing
py --version

Create a virtual environment

A virtual environment keeps each project's dependencies separate. Create a project folder, create a .venv environment inside it and activate it.

mkdir hello-fastapi
cd hello-fastapi
python -m venv .venv

# macOS and Linux
source .venv/bin/activate

# Windows PowerShell
.venv\Scripts\Activate.ps1

Once it is active, your prompt shows (.venv) and anything you install with pip stays inside this folder. Run deactivate when you are done.

Install FastAPI

The recommended way to install FastAPI is with the standard extras. They pull in the commonly used dependencies: the Uvicorn ASGI server, the fastapi command-line tool, HTTPX for testing and python-multipart for form handling.

pip install "fastapi[standard]"

Quote the package name, since some shells treat square brackets specially. To pin what you installed, run pip freeze > requirements.txt, then reproduce the same environment elsewhere with pip install -r requirements.txt. Tools such as uv or Poetry work just as well; with them you list dependencies in pyproject.toml.

Write your first API

Create main.py in the project folder:

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"message": "Hello, world!"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: str | None = None):
    return {"item_id": item_id, "q": q}

The app object created by FastAPI() represents your whole application. A function decorated with an HTTP method, such as @app.get("/"), is called a path operation function. Whatever it returns, whether a dict, a list or a Pydantic model, is converted to a JSON response automatically.

In the second function, {item_id} is a path parameter, and the item_id: int annotation tells FastAPI to convert and validate it as an integer. A request to /items/abc never reaches your function: the client gets a 422 response with JSON explaining exactly what was wrong. Because has a default value, it becomes an optional query parameter such as .

Domande su questo capitolo?
Capitolo successivoProject Structure
q
?q=hello

Run the development server

Start the development server with fastapi dev:

fastapi dev main.py

The terminal shows the server address, the docs URL and the app object it found. In development mode the server restarts every time you save a file, and it listens on http://127.0.0.1:8000 by default. Press Ctrl+C to stop it. Add --port 8080 to use another port. Try it from a browser or with curl:

curl http://127.0.0.1:8000/
curl "http://127.0.0.1:8000/items/5?q=hello"

Automatic API docs

FastAPI builds an OpenAPI schema from your code and serves two documentation UIs out of the box:

URLWhat you get
/docsSwagger UI, where you can call each endpoint from the browser
/redocReDoc, a clean reference-style view
/openapi.jsonThe raw OpenAPI schema as JSON

In /docs, expand an endpoint and click "Try it out" to fill in parameters, send a request and see the response. When you change the code, the docs change with it.

Editor setup

Since FastAPI is driven by type hints, an editor that understands types gives you excellent completion and inline errors.

  • VS Code: install Microsoft's Python extension with Pylance, then choose the interpreter inside .venv via "Python: Select Interpreter".
  • PyCharm: set .venv as the project interpreter and completion and type checking work for FastAPI code.
  • Add Ruff for formatting and linting, and mypy for static type checking.

Summary

  • Create a virtual environment and install with pip install "fastapi[standard]".
  • Define path operations with a FastAPI() app and decorators such as @app.get.
  • Run fastapi dev main.py for a development server that reloads on changes.
  • Explore the generated interactive docs at /docs and /redoc.

0 commenti

Commenti principaliPrima i più recenti

Accedi · Accedi per lasciare un commento.