Making an existing API slow can be easily accomplished combining mock’s Base APIs and the delay option.
$ mock serve -p 8000 --base example.com --delay 2000
You may want however to make a specific endpoint slow instead of the whole API. This can be achieved using middlewares:
$ mock serve -p 8000 --base example.com --middleware '
if [ "${MOCK_REQUEST_ENDPOINT}" = "some/endpoint" ]
then
sleep 2 # wait two seconds
fi
'
With that last example, our API at localhost:8000 will act as a proxy to
example.com. All requests will be responded immediately except
some/endpoint which will have a delay of 2 seconds.