Last updated
Last updated
Berry uses fack/mock data to render some pages and actions. Mocking has been achieved with help of Axios. It helps users to do minimal changes to load live data. Users just need to change the mock API URL to the Live service URL.
Axios has been configured in the folder ..src\utils\axios.js
To use Axios on a page, you need to import it and make a call. After that, you need to make calls to Axios using axios.get('path')
or
axios.post('path')
see below implementation.
Berry has all dummy data in folder src\_mockApis.
For API, api/chat/users
, following data configured in ..\src_mockApis\chat\index.js
:
You can configure the same for post
methods as well.
Mock API calls