// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Http; using Microsoft.Framework.Logging; namespace SampleApp { public class Startup { public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { loggerFactory.MinimumLevel = LogLevel.Debug; loggerFactory.AddConsole(LogLevel.Debug); app.Run(async context => { Console.WriteLine("{0} {1}{2}{3}", context.Request.Method, context.Request.PathBase, context.Request.Path, context.Request.QueryString); await context.Request.Body.CopyToAsync(Console.OpenStandardOutput()); context.Response.ContentLength = 11; context.Response.ContentType = "text/plain"; await context.Response.WriteAsync("Hello world"); }); } } }