Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Last active May 9, 2018 13:02
Show Gist options
  • Save PradeepLoganathan/120ca76b764561c4129b5ff4fa5a7c61 to your computer and use it in GitHub Desktop.
Save PradeepLoganathan/120ca76b764561c4129b5ff4fa5a7c61 to your computer and use it in GitHub Desktop.
OWIN Server and building them using WebHostBuilder.
using System.IO;
using Microsoft.AspNetCore.Hosting;
namespace OWINHost
{
class Program
{
static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.Build();
host.Run();
}
}
}
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Builder;
namespace OWINHost
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.Run(async (context) =>
{
await context.Response.WriteAsync("<h1>Hello from the owin host</h1>");
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment