Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Scott 3 posts 73 karma points
    Apr 10, 2019 @ 03:14
    Scott
    0

    .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. :

    enter image description here

    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.

  • Corné Strijkert 80 posts 456 karma points c-trib
    Apr 10, 2019 @ 12:31
    Corné Strijkert
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft