This tiny demonstration serves HTML to a web browser and JSON over a REST endpoint, using the Flask microframework to handle the details. You can read more about this on my blog.
As the blog post says,
This whole thing cuts so many corners it might as well be a sphere. It's certainly not a production-ready example by any stretch of the imagination; it's only enough for demonstration purposes.