Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
25 lines
1.3 KiB
Bash
Executable File
25 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Boots the packaged jar on a private port and shows the same URL answering twice.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
PORT=${PORT:-18082}
|
|
java -Xmx256m -jar target/thymeleaf-htmx-1.0.0.jar --server.port=$PORT > /tmp/thymeleaf-htmx-live.log 2>&1 &
|
|
PID=$!
|
|
trap 'kill $PID 2>/dev/null || true' EXIT
|
|
for i in $(seq 1 60); do curl -s -o /dev/null localhost:$PORT/contacts && break; sleep 1; done
|
|
B=http://localhost:$PORT
|
|
echo "\$ curl -si $B/contacts | tr -d '\r' | grep -v -E '^(Date|Transfer-Encoding)' | head -10"
|
|
curl -si $B/contacts | tr -d '\r' | grep -v -E '^(Date|Transfer-Encoding)' | head -10
|
|
echo
|
|
echo "\$ curl -si -H 'HX-Request: true' $B/contacts | tr -d '\r' | grep -v -E '^(Date|Transfer-Encoding)' | head -8"
|
|
curl -si -H 'HX-Request: true' $B/contacts | tr -d '\r' | grep -v -E '^(Date|Transfer-Encoding)' | head -8
|
|
echo
|
|
echo "\$ curl -s -o /dev/null -w '%{http_code} %{content_type}\n' $B/webjars/htmx.org/dist/htmx.min.js"
|
|
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' $B/webjars/htmx.org/dist/htmx.min.js
|
|
echo
|
|
echo "\$ curl -si -X DELETE -H 'HX-Request: true' $B/contacts/23"
|
|
curl -si -X DELETE -H 'HX-Request: true' $B/contacts/23 | tr -d '\r' | grep -v '^Date'
|
|
echo
|
|
echo "\$ curl -si -X DELETE -H 'HX-Request: true' $B/contacts/23 (again)"
|
|
curl -si -X DELETE -H 'HX-Request: true' $B/contacts/23 | head -1
|