Low-level web programming in Racket + a wiki in 500 lines

submited by
Style Pass
2021-06-19 17:30:06

I’ve combined all of these concepts together to create a “minimum viable” academic wiki for a small research lab.

Update: Many thanks to Jay McCarthy for pointing out several simplifications for the the code in the article and in the wiki.

Racket has a rich, well-abstracted web programming framework, and the documention includes an excellent tutorial in which it constructs a blogging framework.

Unlike that tutorial, the code in this article avoids using the more advanced features – including continuations – opting instead to explore the low-level features which should be more familiar (and perhaps more comfortable) to programmers that have used other platforms, like node.

The procedure serve/servlet expects to receive a “servlet” – a function that maps incoming requests from clients into responses.

For instance, the paramater #:servlet-regexp accepts a regular expression to determine if it is responsible for a particular path.

Leave a Comment