Browse Source

Add support for serving static files

Frans Bergman 1 year ago
parent
commit
b2cabaab1b
1 changed files with 8 additions and 4 deletions
  1. 8 4
      bin/wesh.sh

+ 8 - 4
bin/wesh.sh

@@ -7,8 +7,12 @@ cd ..
 
 [ -f "$SITE_DIR/_wesh/config" ] && . "$SITE_DIR/_wesh/config"
 
-printf "Content-Type: text/html\n"
-printf "\n"
+if [ -f "./$REQUEST_PATH" ]; then
+    static_file "./$REQUEST_PATH"
+else
+    printf "Content-Type: text/html\n"
+    printf "\n"
 
-handler lib/headers.tpl
-handler lib/default_master.tpl
+    handler lib/headers.tpl
+    handler lib/default_master.tpl
+fi