Last active
April 30, 2018 15:38
-
-
Save mastoj/7172197 to your computer and use it in GitHub Desktop.
Simple self hosted Hello World app using Owin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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