Created
February 28, 2013 08:23
-
-
Save glennblock/5055156 to your computer and use it in GitHub Desktop.
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
using System; | |
using System.IO; | |
using System.Web.Http; | |
using System.Web.Http.SelfHost; | |
var address = "http://localhost:8080"; | |
var conf = new HttpSelfHostConfiguration(new Uri(address)); | |
conf.Routes.MapHttpRoute(name: "DefaultApi", | |
routeTemplate: "api/{controller}/{id}", | |
defaults: new { id = RouteParameter.Optional } | |
); | |
var server = new HttpSelfHostServer(conf); | |
server.OpenAsync().Wait(); | |
Console.WriteLine("Listening..."); | |
Console.ReadKey(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment