bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.78k stars 1.32k forks source link

Integration with json-server #54

Closed genu closed 6 years ago

genu commented 6 years ago

Have you considered integrating https://github.com/typicode/json-server as a mock server rather than the current, more manual approach?

It might add some simplicity and make that logic a little more clear.

chrisvfritz commented 6 years ago

I'd really love to use some API mocking framework. Unfortunately, when I tried json-server for this purpose, I found it was better suited to quick demos than mocking real APIs. There seemed to be no simple way of handling authentication, authorization, status codes with custom messages, and many other common features of real APIs. So for essentially every route, I had to rely on custom middleware, kind of defeating the purpose.

If these things have changed however, I'm open to re-evaluating json-server. I'm also open to any other API mocking framework. I'm personally keeping an eye on mirage-server, but right now, it has essentially no documentation.