SPA with Umbraco
# help-with-umbraco
j
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
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?
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
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
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
+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
2 Views