From the course: Building and Securing RESTful APIs in ASP.NET Core

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Configure MVC

Configure MVC - ASP.NET Core Tutorial

From the course: Building and Securing RESTful APIs in ASP.NET Core

Start my 1-month free trial

Configure MVC

- [Narrator] Before we start writing code, there are a few configuration changes we can make. The launchSettings.json file under properties contains settings that are passed on to IISExpress. In this file change launch browser under the IISExpress profile to false. We'll be using an HTTP client to interact with the API. So having Visual Studio launch a browser each time we run the project just gets in the way. Next open up Startup.cs file. This file contains two important methods. First, the configure services method is where you can add any services you need to the ASP.NET Core Dependency Injection system. The template is already adding the services needed for MVC, which is what does routing and controller logic for ASP.NET Core. Secondly, the configure method sets up the application pipeline. This is where you add the middleware you want to respond to incoming requests. A common pattern for configuring services is to pass some configure options in the configure services block. In…

Contents