Skip to content

Instantly share code, notes, and snippets.

@mastoj
Last active April 30, 2018 15:38
Show Gist options
  • Save mastoj/7172197 to your computer and use it in GitHub Desktop.
Save mastoj/7172197 to your computer and use it in GitHub Desktop.
Simple self hosted Hello World app using Owin.
namespace HelloOwin
{
using System;
using Microsoft.Owin.Hosting;
using Owin;
using AppFunc = System.Func<System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>;
class Program
{
static void Main(string[] args)
{
using(WebApp.Start<Startup>(url: "http://localhost:9765/"))
{
Console.ReadLine();
}
}
}
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Run(context =>
{
var task = context.Response.WriteAsync("Hello world!");
return task;
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment