Accessing the ASP.NET Core Base URL: So Many Ways

Retrieving your ASP.NET Core Base URL Is Possible In a Number of Different Ways

Christopher Laine
IT Dead Inside
Published in
7 min readOct 29, 2022

--

URL - What it is, meaning, types, examples and parts

My Specific Situation: Accessing my App’s base URL for API calls

If you haven’t heard, I’ve been building a Blazor server app for the past ten months. What the app does will come out eventually, but what I can say is the experience has been super fun and educational. In the span of less than a year, I feel I’ve learned more full stack development than I had in the previous three+ years.

I have definitely learned heaps. If you’re keen, have a look at any of my “Let’s Learn Blazor” articles for some of the things I’ve learned in the Blazor space and then passed along to the engineering community. More of these will come out in due course.

One of the things I learned was how to have a Blazor server app call back on its own hosted API controllers, as I wanted the app to operate as API-first as much as possible. This is a super useful pattern in that my Blazor code focuses on presentation, Fluxor is used for state management, and then in my Blazor code or Fluxor Effects, I call the hosted API controllers to get/set data. It’s a tidy pattern and one which has yielded really impressive fruit. I had no issues with it…

--

--