This val is part of a series of examples to introduce "val.town" in my computer science course at Stuttgart University of Applied Sciences.
The idea is to motivate even first-semester students not to wait but to put their ideas into practice from the very beginning and implement web apps with frontend and backend.
It contains a very simple HTTP end point which analyzes the URL path (after the val base URL) and - if the path contains a valid HTTP status code (i.e., an integer in the range 1000...599) - uses that as the status code of the request. Otherwise, it responds with status code 500 "bad request".
In order to use it, send a request similar to the following
https://rozek-gdi_statuscodeservice.web.val.run/418
Nota bene: since this val may respond with an HTTP error code, don't be surprised if you use this val from within a browser and the browser presents an error message!
The code was created using Townie - with only a few small manual corrections.
This val is licensed under the MIT License.