What are the conventions for providing public URLs for resources managed through a single page application? I think this is a matter of architectural design, but I look forward to developing SPA in AngularJS, if that matters. I am new to SPA.
The user will create, view and modify resources (for example, server objects) of various types through SPA. These same resources will also be available to the general public through the URLs of permalinks. I am fine with a SPA showing a resource for visitors when visiting a resource link URL.
I can only think of these two approaches:
- Put all the resources in
http://example.com/resourcetype/resourceID, implementing the RESTful API here (by changing the HTTP method). - Put all permalinks in
http://example.com/resourcetype/resourceIDand click SPA http://example.com/api/resourcetype/resourceID.
(The constants seem to /apihave no permalinks. By "permalink", I mean only the public URL to enter the resource.)
I would prefer that the user who went to the resource through SPA come to the shared URL, because the user who wants to share this page will first think about sharing his URL, and not first find the link to the permanent link page. This involves using the first approach, but the second approach is better for API versions via URLs such as /api/v1, /api/v2etc.
URL-. , HTML5 AngularJS, , . , , URL SPA.
, , SPA. !