This is what I came up with:
This gist is a patch to Server.py that adds an endpoint called text. This endpoint points at a static file in a local directory called custom_static.
Of course, this is kind of a short term solution…
The github issue seems to have other proposals to do this as well.
Matteo