]> git.plutz.net Git - flarejs/blob - index.cgi
shortcut functions for animation and dressing
[flarejs] / index.cgi
1 #!/bin/sh
2
3 . cgilite/cgilite.sh
4 . cgilite/file.sh
5
6 _PATH="$(PATH "${PATH_INFO}")"
7
8 if [ "$_PATH" = / ]; then
9   printf 'Content-Type: text/html\r\n\r\n'
10   cat <<-EOF
11         <!DOCTYPE HTML>
12         <html><head>
13           <title>FlareJS</title>
14         </head><body>
15           <canvas id="view" width=480 height=320 style="border: 1px solid red;"></canvas>
16           <script type="text/javascript" src="/engine.js"></script>
17         </body></html>
18         EOF
19 elif [ "$_PATH" = /favicon.ico ]; then
20   printf 'Status: 200 OK\r\nContent-Length: 0\r\n\r\n'
21 else
22   for base in . \
23               ./mods/empyrean_campaign \
24               ./mods/fantasycore \
25               ./mods/default; do
26     [ -f "${base}/$_PATH" ] && FILE "${base}/$_PATH"
27   done
28 fi