Created
February 16, 2012 11:16
-
-
Save AlexZeitler/1844150 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
| static void Main() | |
| { | |
| var config = new HttpSelfHostConfiguration("http://localhost:9191"); | |
| config.Routes.MapHttpRoute("default", "{controller}/{id}", | |
| new { id = UrlParameter.Optional }); | |
| var builder = new ContainerBuilder(); | |
| builder.Bind<ICustomerRepository, CustomerRepository>(); | |
| var container = builder.Build(); | |
| config.ServiceResolver.SetResolver( | |
| t => container.Resolve(t), | |
| t => container.ResolveAll(t)); | |
| var host = new HttpSelfHostServer(config); | |
| host.OpenAsync().Wait(); | |
| Console.WriteLine(@"Host open - press any key to close"); | |
| Console.ReadLine(); | |
| host.CloseAsync().Wait(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment