public void StartWebServer(int port, string name) { _deviceName = name; _webServer = NetworkServices.GetWebServer(); _webServer.RegisterAPIHandler(new Api.MotionApi(_soccerBot, _logger)); _webServer.DefaultPageHtml = GetDefaultPageHTML("Ready"); _webServer.StartServer(port); }
private void StartWebServer(int port, string name) { _deviceName = name; try { _webServer = NetworkServices.GetWebServer(); _webServer.RegisterAPIHandler(new MotionRestAPI(_tankBot, _logger)); _webServer.RegisterAPIHandler(new MotionController(this, _logger)); _webServer.DefaultPageHtml = GetDefaultPageHTML("Ready"); _webServer.StartServer(port); } catch (Exception ex) { _logger.NotifyUserError("ConnectionManager_StartWebServer", ex.Message); } }