R
R
Roxed2020-05-13 18:43:40
JavaScript
Roxed, 2020-05-13 18:43:40

How to block service calls?

Good afternoon. The essence of the problem is as follows - it is necessary to finalize the project, they gave access to the repository with ui, the project cloned, collected, but they did not provide access to the api (test environment) i.e. in fact, the application is not working (do not log in, or go to the desired screen), access was promised, but it will not be soon. Development needs to start now. It was suggested to develop on mocks, is it possible to somehow block service calls so that it responds with static JSON, and are there any ready-made solutions for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-05-13
@firedragon

Make an interface, and 2 implementations. The mock implementation returns a simple json, in principle this is standard practice. Then just switch to the provided api. Check out the cart example on vuex.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question