Hello, recently created a .Net web api project, I've the installed UmbracoCMS within it. We will have a single page application which calls our web api project which in turn returns data from Umbraco, within the API we plan to query umbraco by document id's etc.
the issue I have is when I run the project, instead of displaying the Web Api home page I'm greeted with the following, so it's basically ignoring the Web Api Controllers and serving the umbraco views instead. :
Can someone please tell me how I go about ignoring umbraco from a routing perspective and only register my Web Api routes etc
That being said, by default all requests are going through the Umbraco request pipeline. I think the most easy way to start is to have a single Website node in your Umbraco tree with a template that contains your SPA.
You can consider to have your Umbraco envrionment on separate domain (for sure when you allow multiple SPA's/website to use your Umbraco content API) or exclude the homepage from going throught the Umbraco request pipeline by adding this to the ReservedPaths/ReservedUrls appSettings in the web.config. The settings are used for excluding specific URL's from the Umbraco pipeline. Because you are talking about a SPA this approach maybe will work.
.Net Web Api routes being ignored by Umbraco v8
Hello, recently created a .Net web api project, I've the installed UmbracoCMS within it. We will have a single page application which calls our web api project which in turn returns data from Umbraco, within the API we plan to query umbraco by document id's etc.
the issue I have is when I run the project, instead of displaying the Web Api home page I'm greeted with the following, so it's basically ignoring the Web Api Controllers and serving the umbraco views instead. :
Can someone please tell me how I go about ignoring umbraco from a routing perspective and only register my Web Api routes etc
I found the following: https://www.andreasjohansson.eu/technical-blog/configuring-custom-web-api-routing-for-umbraco-sites/
Which unfortunately didn't help the issue.
Hi Scott,
It seems that you would like to use Umbraco as a 'headless' envrionment. I think you should definitely take a look on https://our.umbraco.com/documentation/Umbraco-Cloud/Headless/
That being said, by default all requests are going through the Umbraco request pipeline. I think the most easy way to start is to have a single Website node in your Umbraco tree with a template that contains your SPA.
You can consider to have your Umbraco envrionment on separate domain (for sure when you allow multiple SPA's/website to use your Umbraco content API) or exclude the homepage from going throught the Umbraco request pipeline by adding this to the ReservedPaths/ReservedUrls appSettings in the web.config. The settings are used for excluding specific URL's from the Umbraco pipeline. Because you are talking about a SPA this approach maybe will work.
is working on a reply...