Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
namespace Server.Http
public class HttpServer
private static IWebHost Host;
public static void Start()
string ip = "";
string url = string.Format("http://{0}:9696/", ip);
Host = new WebHostBuilder()
.ConfigureLogging(builder => ConfigureLogging(builder))
.Configure(app => Configure(app))
private static void ConfigureLogging(ILoggingBuilder builder)
private static void Configure(IApplicationBuilder app)
app.Map("/hello", HelloHandler);
private static void HelloHandler(IApplicationBuilder app)
app.Run(async context =>
context.Response.ContentType = context.Request.ContentType;
await context.Response.WriteAsync("Hello");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment