Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Exploration of the PLT web server...
#lang racket
(require web-server/dispatch
(define-values (dispatch blog-url)
[("") serve-static]
[("go" (string-arg)) go]
[else (next-dispatcher)]
(define (serve-static req)
;; Actually, I'd like to serve static content here.
;; Perhaps from a directory that has the path ./htdocs/
;; relative to the server launch point.
`(div (p "serve") )))
(define (go req json)
;; If they hit /go, then I'd like to do something.
`(div (p "go")
(p ,json))))
;; Some magic happens down here that might let
;; me make the above happen
(serve/dispatch dispatch)
;; I was playing with things down here, and this wasn't getting
;; me anywhere in particular.
(serve/servlet start
#:launch-browser? #t
(list (build-path (current-directory) "htdocs"))
#:servlet-path "/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.