summaryrefslogtreecommitdiff
path: root/docs/serve.sh
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2017-08-22 10:05:20 +0300
committerRasmus Andersson <rasmus@notion.se>2017-08-22 12:23:08 +0300
commit3b1fffade1473f20f2558733fbd218f4580fc7c3 (patch)
treeea4f80b43b08744d493bb86ab646444ec04ddc7f /docs/serve.sh
downloadinter-3b1fffade1473f20f2558733fbd218f4580fc7c3.tar.xz
Initial public commitv1.0
Diffstat (limited to 'docs/serve.sh')
-rwxr-xr-xdocs/serve.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/serve.sh b/docs/serve.sh
new file mode 100755
index 000000000..c9cb7b6ef
--- /dev/null
+++ b/docs/serve.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+set -e
+cd "$(dirname "$0")"
+
+if (which caddy >/dev/null); then
+ caddy_args=(\
+ -host localhost \
+ "bind localhost" \
+ "mime .woff2 font/woff2" \
+ "mime .woff application/font-woff" \
+ )
+ caddy "${caddy_args[@]}"
+elif (which servedir >/dev/null); then
+ servedir
+else
+ echo "Can not find 'caddy' nor 'servedir' in PATH." >&2
+ echo "Install caddy from brew, apt or https://caddyserver.com/download"
+ echo "or install servedir with 'npm install -g secure-servedir'"
+ exit 1
+fi