example/web.ss
#lang scheme/base
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SHP: Hypertext Processor
;;
;; a PHP like web framework for PLT Scheme
;;
;; Bonzai Lab, LLC.  All rights reserved.
;;
;; Licensed under LGPL.
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; web.ss
;; a sample single servlet web server with shp.
(require web-server/servlet
         web-server/servlet-env
         mzlib/etc
         "servlet.ss"
         )
(define (run! (port 8001) (htdocs (this-expression-source-directory)))
  (thread (lambda ()
            (serve/servlet start #:port port
                           #:servlet-path "/"
                           #:launch-browser? #f
                           #:listen-ip #f
                           #:servlet-namespace '( "servlet.ss")
                           #:servlets-root (this-expression-source-directory)
                           #:servlet-regexp #px".*"
                           #:server-root-path (this-expression-source-directory)
                           #:extra-files-paths (list (if (path? htdocs) 
                                                         htdocs
                                                         (string->path htdocs)))
                           ))))
;;(provide run!)
(run! 8001 (build-path (this-expression-source-directory) "shp"))