Created
November 7, 2016 15:58
-
-
Save igloo15/5e7cd0bc16a0f83ccfe7016aef2b7169 to your computer and use it in GitHub Desktop.
Startup class for dot net core kestrel
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
using Microsoft.AspNetCore.Builder; | |
using Microsoft.Extensions.DependencyInjection; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace WebServer.Main | |
{ | |
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection serviceCollection) | |
{ | |
serviceCollection.AddDirectoryBrowser(); | |
serviceCollection.AddMvc().AddJsonOptions(options => | |
{ | |
options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore; | |
}); | |
} | |
public void Configure(IApplicationBuilder appBuilder) | |
{ | |
appBuilder.UseFileServer(enableDirectoryBrowsing: true); | |
appBuilder.UseMvc(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment