how can i save data to mockapi serve?

Viewed 163

i learn ReactJS, And i have homework task. I need create chat. And i need use mockApi server. I chose Mockoon. Server works fine and i can see my data at React app. But how can i save my data to Api?

this is my axios request:


axios.post(`http://localhost:9000/user/`, { user })
  .then(res => {
     console.log(res);
  })

as i understand {user} should send to api my data. But if i see at console i can see this:

here what i see at console

my data at config: and not at data: and this only at browser. If i reload page al reseted.

So here question, can i save my data from input to mockapi serve?

1 Answers

This is possible with mockswitch - it supports various connectors example local drive (saves to file system ), github (user defined github account - great if you are doing, mongo etc.

Their docs is available here https://mockswitch.com/docs/#storage

Related