Home  >  Q&A  >  body text

Can mock.js store data - Stack Overflow

Mock.js can forge data and intercept ajax requests and return forged data. So I want to ask, does mock.js support updating data? For example, if I post a request to add a piece of data or modify a piece of forged data, can mock.js do it? If it can't be done, is it possible to build a simple mock server by yourself?

PHPzPHPz2713 days ago901

reply all(1)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 13:46:22

    The storage you are talking about is not persistent storage. In this way, the data can be temporarily stored. Create a new temporary variable in mock.js and save it. As long as mock.js does not restart, the data will be there

    reply
    0
  • Cancelreply