Lokaal .py code testen

A. Testen met Uvicorn

Als je FastAPI gebruikt, kun je Uvicorn lokaal draaien:

  1. Zorg dat je virtuele omgeving (venv) actief is: venv\Scripts\activate
  2. Voer het volgende commando uit: uvicorn main:app --reload
  3. Open je browser of Postman om je endpoints te testen:
    • Bijvoorbeeld: http://127.0.0.1:8000/

Code voor NLP Generatie:

curl -k -X POST “https://ckba-main-fastapi-production.up.railway.app/answer” -H “Content-Type: application/json” -d “{\”question\”: \”Wat is FastAPI?\”}”