Hacker News new | ask | show | jobs
by Bogdanp 2224 days ago
You don’t have to specify those things yourself unless you want to manually construct a response struct. There are helpers like response/xexpr and response/output that construct responses for you.

This article might help: https://defn.io/2020/02/12/racket-web-server-guide/

1 comments

But if I wanted to say return a 404 I don't want to have to specify "Not Found" along with it every time.
As of a couple releases ago, the message gets set according to the status code so this code would behave as expected:

    (response/xexpr #:code 404 '(h1 "Not Found"))