add script/server

This commit is contained in:
2026-09-19 06:22:16 -09:00
parent 6f7a6dbf56
commit 2fcdb17fdd
2 changed files with 20 additions and 3 deletions
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Start the server. Usage: script/server [port]
# The port defaults to $PORT, then 3000.
set -euo pipefail
cd "$(dirname "$0")/.."
port=${1:-${PORT:-3000}}
if [[ ! $port =~ ^[0-9]+$ ]] || (( port < 1 || port > 65535 )); then
echo "usage: script/server [port] (port must be 1-65535, got '$port')" >&2
exit 2
fi
PORT=$port exec clojure -X:run