diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2020-03-17 16:10:23 +0100 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2020-06-28 17:18:45 +0200 |
commit | bb34d2b128ebc1b95f7cbd40876689707eb1e1e0 (patch) | |
tree | 2262dd6c1332e5526700ecb8e138daca8a1c7bd3 /run_lighttpd.sh |
Initial commit
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'run_lighttpd.sh')
-rwxr-xr-x | run_lighttpd.sh | 26 |
1 files changed, 26 insertions, 0 deletions
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" |