#!/usr/bin/env chicken (use spiffy uri-common intarweb medea matchable tcp6) (root-path "/var/www") (vhost-map `(((* any) . ,(lambda (continue) (match (uri-path (request-uri (current-request))) ['(/ "commit") ;; get data which should be committed ;; do commit ;; send response that everything worked fine (send-response body: (json->string '((status . "ok"))) headers: '((content-type application/json)))] ['(/ "log") ;; read parameter, if we got a count parameter display latest n commits else ;; display just the newest (send-response body: (json->string '((foo . "bar"))) headers: '((content-type application/json)))] ['(/ "easteregg") (send-response body: (json->string `((status . "ok") (ip . ,(remote-address)))) headers: '((content-type application/json)))] (continue)))))) (print "Entering Quietzone") (define listener (tcp-listen 1338)) (debug-log "log.txt") (start-server listener: listener accept: tcp-accept addresses: tcp-addresses)