static void Main(string[] args) { var host = new HttpHost("http://localhost:8080"); host.Add(new CommandBind(new VerySimpleCommand(), HttpMethod.Get, new UriTemplate("*"))); host.Open(); Console.WriteLine("Server is running, press any key to continue..."); Console.ReadKey(); host.Close(); }
static void Main(string[] args) { var host = new HttpHost("http://localhost:8080"); host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(typeof(Controller))); host.Open(); Console.WriteLine("Server is running, press any key to continue..."); Console.ReadKey(); host.Close(); }
static void Main(string[] args) { var host = new HttpHost("http://localhost:8080"); host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(typeof(ToDoController))); host.Open(); Console.WriteLine("Server is running, press any key to continue..."); Console.ReadKey(); host.Close(); }
/// <summary> /// This Operation is called, when the module shall initialize itself. /// </summary> /// <param name="typeRegistry">The type registry for service requests or registrations.</param> /// <inheritdoc/> public void Initialize(ITypeRegistry typeRegistry) { // initialize mapping var mappingService = typeRegistry.GetObject <IODataMappingService>(); mappingService.InitializeMapping(); // create and start host var config = WebApiInitializer.Configure(mappingService.GetODataRepository(), new ConsoleLogger()); var host = new HttpHost(config); typeRegistry.RegisterInstance <IHttpHost>(host); host.Open("http://local.facton.local"); }
public IntegrationTests() { _host = new HttpHost("http://localhost:8080"); _host.Add(DefaultMethodBasedCommandFactory.GetCommandsFor(typeof(Controller))); _host.Open(); }