httpd: routes: wip
diff --git a/lib/kc3/0.1/httpd.kc3 b/lib/kc3/0.1/httpd.kc3
index 1f207e1..4ebbc62 100644
--- a/lib/kc3/0.1/httpd.kc3
+++ b/lib/kc3/0.1/httpd.kc3
@@ -78,8 +78,15 @@ defmodule HTTPd do
%HTTP.Response{code: 404, body: body}
}
+ def root_dir = "."
+
def route_request = fn (request) {
- error_404_page
+ path = root_dir + request.url
+ if File.exists?(path) do
+ debug_page
+ else
+ error_404_page
+ end
}
end