I am currently adding a mock data middleware into my application.
My idea is using middleware as a mock server, and integrate with the production code. When an endpoint is not implemented in the app, it returns a mock data from middleware layer.
saying there's a server
request a (GET: /not-in-app)
goes into the server, and hit middleware route (:/not-in-app) and return.
request a (GET: /in-app)
goes into the app, and hit middleware route somehow aware the app already handled the request and transparently pass the result to client.
I wonder is that possible, or in this scenario is middleware the best choice?