File: server.sh

package info (click to toggle)
debci 3.13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,656 kB
  • sloc: ruby: 6,516; sh: 2,437; javascript: 100; makefile: 92; perl: 11
file content (30 lines) | stat: -rwxr-xr-x 644 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

set -e

# Note the line below: this script is for development only. DO NOT EVER use
# this script for a production deployment.
export FAKE_CERTIFICATE_USER=$USER

case $# in
  0)
    port=8080
    ;;
  1)
    port="$1"
    ;;
  *)
    echo "usage: $0 [PORT]"
    ;;
esac

echo "I: Web UI at http://localhost:$port/"
echo "I: Web UI at https://localhost:$((port + 1))/"
echo "I: Hit Control+C to stop"
echo ""
exec rerun \
  --name $(basename $0 .sh) \
  --no-notify \
  --background \
  -p '{config.ru,lib/**/*.rb}' -- \
  puma --silent --quiet --include lib --bind=tcp://0.0.0.0:${port} --bind=ssl://0.0.0.0:$((port + 1)) config.ru