Sorry you are running into issues. I took a look at your repository and think I know what is going on here. You are expecting the
app.UseDeveloperExceptionPage(); configuration call in your
Startup.cs to show the developer exception page for all routes in the application.
This configuration is intended to be used with endpoints that return UI. Web API is intended to be consumed programmatically, so return html error pages are probably not desired. The “error” you are getting in your browser is an HTTP status code of 401 Unauthorized, which is also expected. You can see the message in your browser’s developer tools.
Your browser then shows the default 401 status code message page for your browser. If you would rather have a text based representation of the status code displayed, you can change your configuration like this:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
/* This only works for MVC
webapi is intended to be accessed programmatically
so it will not render UI by default */
/* This will cause webapi to send back a friendly status
message for errors */
Ensure that you add
app.UseStatusCodePages(); near the top of your middleware pipeline before any other middlewares that handles responses.
For reference, I created a sample project for you that you can use to see all the configuration needed.
Hope that helps.