lundi 5 décembre 2016

Node lite-server: how to route a request to the contents of an arbitrary file

I have an SPA that requests data at a specific REST url, say, "/things".

In my production server, this request is handled by a query to a database and the construction of JSON to represent the result. Nothing fancy.

How would I configure lite-server (or BrowserSync) to respond to a GET at "/things" with the content of "/testdata/test-things.json"?

I apologize if this question has been answered (it feels like a very rudimentary use case), but neither the docs for lite-server nor for BrowserSync answer the question, and the Google has failed me.

Aucun commentaire:

Enregistrer un commentaire