I am planning on using Umbraco with content delivery API as backend and build a SPA client frontend.
My plan is to use the same base URL for both so that example.com/umbraco may be reached by editors and visitors go to example.com/
But what about routing? Will my client routing allow /umbraco to break out and maybe more importantly will Umbraco let example.com/anyslug be reached by my client?
Any thoughts / experiences on this? Is it better to just use different addresses / ports?
i
Ian Robinson
03/19/2024, 11:55 AM
The routing may be an issue as you say. Someone else might be able to tell you for sure. You could give it a try and see what you find, but I would be tempted to put your front end SPA on one URL (e.g. example.com) and your backoffice on another (e.g. api.example.com, or api-example.com), then use an API controller maybe to return the JSON to your SPA?
Ian Robinson
03/19/2024, 11:58 AM
Then you will have seperated the two concerns and your SPA is solely responsible for the routing on the frontend. This way you could even seperate the code bases and have one repo for the frontend SPA and another for the Umbraco site.
j
Josef Henryson
03/19/2024, 12:28 PM
Found this that I am reading now. Sounds quite similar to what I want to do. But perhaps a separation might be good anyway.
https://dev.to/mozaky/series/22504
t
Tronglonok
03/19/2024, 12:55 PM
I'd suggest having them seperate to avoid issues... Thats what I've done when I've made SPA's atleast... But I couldn't tell you exactly how much work it would be to have them run on the same domain.
l
Liam
03/19/2024, 12:58 PM
+1 for hosting on different URLs. You can usually configure a SPA router to ignore a path, but maintaining that long-term is awkward, with not too many benefits