Sometimes you may need more complex status page generating. For example, you want to put a random public service advertising when the visitors encountered a 404 (page missing). Then you can do it like this:
(http-status status-code thunk-handler)
Let’s see an example:
;; You may put this code in any controller module. (http-status 404 (lambda () (view-render "psd_404" (the-environment))))
In this example, "psd" stands for public-service-advertising, and "psd_404" tells the view-render to find "psd_404.html" in your_app_folder/sys/pages/psd_404.html. So you can render the HTML template to generate a status page. Of course, there’re a few ways to implement the similar idea. If you don’t want to render template on the backend, you may generate a JSON and let the frontend framework to generate it.