Skip to content

Instantly share code, notes, and snippets.

@dkvasnicka
Created May 26, 2013 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkvasnicka/5653494 to your computer and use it in GitHub Desktop.
Save dkvasnicka/5653494 to your computer and use it in GitHub Desktop.
Primitive RESTful hello world in Racket. Run racket (racket -il xrepl) and load the file (,rr app.rkt). Browse to http://localhost:8000/hello/whatever Uses Spin https://github.com/dmacdougall/spin No buildfile needed or anything... Racket requires the library from disk or downloads it from the central repo (PLaneT) if needed. Übercool.
#lang racket
(require (planet dmac/spin))
(get "/hello/:name" (lambda (req) (string-append "Hello, " (params req 'name))))
(run)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment