| 1 | #!/bin/bash |
| 2 | |
| 3 | # Nghttpx should proxy the port 80 by default. |
| 4 | |
| 5 | exec 2>&1 |
| 6 | set -eux |
| 7 | |
| 8 | PROXY=http://localhost:3000 |
| 9 | |
| 10 | # Verify that we can connect |
| 11 | nghttp ${PROXY} > /dev/null |
| 12 | |
| 13 | # Extract HTTP error code |
| 14 | STATUS=$(nghttp ${PROXY} -v | grep -Po '(?<=:status: )(\d+)') |
| 15 | |
| 16 | # Verify it's OK (200). |
| 17 | echo ${STATUS} | grep 200 |