فهرست منبع

Add support for serving static files

Frans Bergman 4 سال پیش
والد
کامیت
b2cabaab1b
1فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  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