Skip to content

Instantly share code, notes, and snippets.

@igloo15
Created November 7, 2016 15:58
Show Gist options
  • Save igloo15/5e7cd0bc16a0f83ccfe7016aef2b7169 to your computer and use it in GitHub Desktop.
Save igloo15/5e7cd0bc16a0f83ccfe7016aef2b7169 to your computer and use it in GitHub Desktop.
Startup class for dot net core kestrel
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