How do I create a route to a raw text file I'm working on a Drupal 8 module, and I would like to include a couple of text files, each of simulated json data, as examples. How would I include these files in my module and create a route in the module.routing.yml file that would tell Drupal that when a visitor comes to mysite.com/examples/json1 to just print the text file (json data) as-is?
There might be a clever solution for this, but a simple straight forward solution would be to:


Make a Controller and use that in your routes.
In the method on the controller, load the contents of the file (or just hardcopy it into your controller method)
Return a JSON response in your controller.


I haven't gone into details on how to code this, there are plenty of code examples and documentation on this on drupal.org