Simple API mock using nc (or netcat)
- nc (or netcat)
- Create your
response
file under directory that same with request path For example you want to create mock for GET /healthz Create fileresponse
underresponses/GET/healthz/
folderresponses
is mandatory - Write you response HTTP inside your
response
file For example to send simple 200 OK you can do thisHTTP/1.1 200 OK Content-type: text/html OK
- Run your script
./wailea.sh
- Access from port
1080
curl localhost:1080/healthz -v