Alex Ivasyuv
Alex Ivasyuv

Reputation: 8824

Ember Mirage persist data

Currently, when I delete or change some records (model), I can see HTTP requests that intercepted by Mirage, and data on page really changes. But after page reload - it returns back. Is it possible to configure Mirage somehow to avoid rollback data after page reload, and allow me to do it manually?

Upvotes: 2

Views: 726

Answers (1)

user9903
user9903

Reputation:

I suspect your issue is that Ember Mirage is being reloaded on the page reload (which makes sense).

You will want to create your own server that your frontend will connect to that maintains fake/mock responses and can persist the data. You can use something like fake-server or MockServer or just write your own code in Node/Ruby/Python/whatever language that fakes the REST API for your Ember app. This is the only way to maintain persistent data since your Ember app is short-lived within a browser.

Upvotes: 3

Related Questions