Is this the right way to save state of my ASP.NET/Angular app as a URL?
I have an ASP.NET Core + Angular project.
Once a file is uploaded to my ASP.NET API, a JSON is returned which is used by the Angular frontend.
I want to be able to click a SAVE button in frontend, and save that exact state of the APP to a URL (ie: example.com/r/wrhwrthj).
I thought of a way to do this.
1) When the save button is clicked, the JSON is sent to an API: POST URL: /SaveState/ BODY: jsonString
2) The API uses entity framework to save the current state to a MySQL table of { StateID, StateValue }
3) If Angular detects a route of /r/{x}, it requests the JSON from /GetState?id={x}
Is this a good approach to the problem I'm trying to solve? Will appreciate all feedback. Thank you!
2 Replies