4 ms·
> I'd love to see some examples of Lisp for something like a REST controller, where I call services, repositories etc. Not exactly what you're looking for, but
by klibertp 10y ago
> I'd love to see some examples of Lisp for something like a REST controller, where I call services, repositories etc.
Not exactly what you're looking for, but take a look at my post: https://klibert.pl/posts/racket_quickie.html https://klibert.pl/posts/racket_quickie.html
It shows a little JSON-based REST service which stores a list of messages and allows listing them and adding to them. With more URLs you'd likely use something like this: http://docs.racket-lang.org/web-server/dispatch.html http://docs.racket-lang.org/web-server/dispatch.html for dispatch, instead of hand-coded function.
It's notable for only using stdlib, no additional packages (beyond purely syntactic, Clojure-like, `~>` support).
To be honest, the APIs exposed in the stdlib feel kind of awkward - like using SimpleHTTPServer in Python. Still, it's just a couple of lines and easy (automatic, in this example) in-process concurrency is not bad.