aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--webstats/readme.org20
-rw-r--r--webstats/server.lisp4
-rw-r--r--webstats/stats.paren2
3 files changed, 23 insertions, 3 deletions
diff --git a/webstats/readme.org b/webstats/readme.org
new file mode 100644
index 0000000..d3908e9
--- /dev/null
+++ b/webstats/readme.org
@@ -0,0 +1,20 @@
+#+title: Track website visit statistics
+
+* Setup lighttpd
+On the config file append the proxy to the running lisp server
+#+begin_src conf
+server.modules += ( "mod_proxy" )
+
+$HTTP["url"] =~ "^/stats/" {
+ proxy.server = ("" =>
+ ( "hunchentoot" =>
+ ( "host" => "127.0.0.1",
+ "port" => 4252 )
+ )
+ )
+ proxy.header = (
+ "map-urlpath" => ( "/stats" => "" )
+ )
+
+}
+#+end_src
diff --git a/webstats/server.lisp b/webstats/server.lisp
index 4fecc1f..44dbe89 100644
--- a/webstats/server.lisp
+++ b/webstats/server.lisp
@@ -85,13 +85,13 @@
(:doctype)
(:html
(:header (:title "hu yu ipi")
- (:script :src "/stats.js" :type "text/javascript"))
+ (:script :src "/stats/stats.js" :type "text/javascript"))
(:body
(:p "learning "
(:a :href "vars" "some explodiert")
(:a :href "visit" "count visit"))
- (:form :action "/visit"
+ (:form :action "/stats/visit"
:method "post"
(:input :type "text" :name "title")
(:input :type "submit" :value "submit" :name "submit"))))
diff --git a/webstats/stats.paren b/webstats/stats.paren
index a4f6957..b9d3974 100644
--- a/webstats/stats.paren
+++ b/webstats/stats.paren
@@ -4,7 +4,7 @@
(in-package :webstats-js)
(defun register-visit (data)
- (fetch "http://localhost:4252/visit"
+ (fetch "http://localhost/stats/visit"
(create :method "POST"
:headers (create "Content-Type" "application/x-www-form-urlencoded")
:body (new (-u-r-l-search-params data)))))