From bb34d2b128ebc1b95f7cbd40876689707eb1e1e0 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 17 Mar 2020 16:10:23 +0100 Subject: Initial commit Signed-off-by: David Oberhollenzer --- run_lighttpd.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 run_lighttpd.sh (limited to 'run_lighttpd.sh') diff --git a/run_lighttpd.sh b/run_lighttpd.sh new file mode 100755 index 0000000..0f45714 --- /dev/null +++ b/run_lighttpd.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +LIGHTTPDCONF="lighttpd.conf" + +preview_lighttpd_conf() { +cat <<_EOF +server.document-root = "$(pwd)" +server.port = 8080 + +index-file.names = ( "index.html" ) + +mimetype.assign = ( + ".html" => "text/html", + ".css" => "text/css", + ".jpeg" => "image/jpeg", + ".jpg" => "image/jpeg", + ".png" => "image/png", + ".gif" => "image/gif" +) +_EOF +} + +echo "Launching server for preview: http://localhost:8080/" + +preview_lighttpd_conf > "$LIGHTTPDCONF" +lighttpd -D -f "$LIGHTTPDCONF" -- cgit v1.2.3