summaryrefslogtreecommitdiff
path: root/run_lighttpd.sh
blob: 0f45714348474aabf7d1351f7359da4a194b7004 (plain)
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
#!/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"