diff options
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" |