Last active
March 27, 2019 03:56
-
-
Save sainture/9aa3c3bf1f0e0bc7be09cc5fd934f3bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The ASP.NET Core architecture features a system of middleware, which are pieces of code that handle requests and responses. Middleware are chained to each other to form a pipeline | |
| // Incoming requests are passed through the pipeline, where each middleware has a chance to do something with them before passing them to the next middleware. Outgoing responses are also passed through the pipeline, in reverse order. | |
| // (ex: MVC is a middleware, Auth is a middleware, serve static files is also a middleware) | |
| // ConfigureServices method of Startup class | |
| // add MVC middleware | |
| services.AddMVC() | |
| // to add a default route along with MVC middleware | |
| app.UseMvc(routes => | |
| { | |
| routes.MapRoute( | |
| name: "default", | |
| template: "{controller=Conference}/{action=Index}/{id?}"); | |
| }); | |
| // static files middleware | |
| app.UseStaticFiles(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment