Exemplo n.º 1
0
 public void InitializeHttpApi()
 {
     _httpServer = new HttpServer();
     HttpRequestDispatcher httpRequestDispatcher = new HttpRequestDispatcher(_httpServer);
     _apiController = httpRequestDispatcher.GetController("api");
     _apiController.Handle(HttpMethod.Get, "read").Using(HandleApiRead);
     _apiController.Handle(HttpMethod.Post, "write").Using(HandleApiWrite);
     _httpServer.StartAsync(80).Wait();
 }