Skip to content

miolab/fastapi_postale_response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Postale Response

HTTP Request Endpoint mock. (for personal use)

  • Versions

    docker run --rm -it fastapi-postale-response python -V

    Python 3.11.3

    docker run --rm -it fastapi-postale-response uvicorn --version

    Running uvicorn 0.21.1 with CPython 3.11.3 on Linux

Example use

docker build -t fastapi-postale-response .
docker run --rm -p 8080:8080 -it fastapi-postale-response

INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
curl "http://0.0.0.0:8080" -X POST \
  -H 'Content-Type: application/json' \
  -d '{
    "status": "ping"
  }' | jq

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    43  100    17  100    26    141    216 --:--:-- --:--:-- --:--:--   358
{
  "status": "pong"
}

Execute test

docker run --rm -it fastapi-postale-response pytest --pyargs app

About

HTTP Request Endpoint mock. (for personal use)

Topics

Resources

Stars

Watchers

Forks