From e97b910c70d175f30d082861555571f044c323cc Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 9 Jul 2020 19:40:49 +0530 Subject: Add comments to ennu-server-start. * ennu.el (ennu-server-start): Add comments. --- ennu.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ennu.el') diff --git a/ennu.el b/ennu.el index c19799f..d7f6cca 100644 --- a/ennu.el +++ b/ennu.el @@ -501,11 +501,17 @@ as keys. Keys are compared using `equal'." (let ((uri-path (httpd-unhex uri-path)) (file-path (httpd-gen-path uri-path))) (cond + ;; If a HTML file other than index.html was requested, reject + ;; that request. ((and (not (string= (file-name-nondirectory file-path) "index.html")) (string= (file-name-extension file-path) "html")) (httpd-error proc 404)) + ;; If the requested file was found, serve it. ((= (httpd-status file-path) 200) (httpd-serve-root proc httpd-root uri-path request)) + ;; Perhaps, this is a post or other HTML file that is being + ;; requested. Try serving a file with a .html extension + ;; appended. (t (httpd-serve-root proc httpd-root (concat uri-path ".html") request))))) (httpd-start) (message "Ennu web server listening at http://localhost:%d" httpd-port)) -- cgit v1.2.3