github.com/SupersunnySea/draft@v0.16.0/examples/example-dotnet/Startup.cs (about)

     1  using System;
     2  using System.Collections.Generic;
     3  using System.Linq;
     4  using System.Threading.Tasks;
     5  using Microsoft.AspNetCore.Builder;
     6  using Microsoft.AspNetCore.Hosting;
     7  using Microsoft.AspNetCore.Http;
     8  using Microsoft.Extensions.DependencyInjection;
     9  using Microsoft.Extensions.Logging;
    10  
    11  namespace WebApplication
    12  {
    13      public class Startup
    14      {
    15          // This method gets called by the runtime. Use this method to add services to the container.
    16          // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
    17          public void ConfigureServices(IServiceCollection services)
    18          {
    19          }
    20  
    21          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    22          public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
    23          {
    24              loggerFactory.AddConsole();
    25  
    26              if (env.IsDevelopment())
    27              {
    28                  app.UseDeveloperExceptionPage();
    29              }
    30  
    31              app.Run(async (context) =>
    32              {
    33                  await context.Response.WriteAsync("Hello World!");
    34              });
    35          }
    36      }
    37  }