public async Task InitializeWebServer()
        {
            var webserver = new RestWebServer(8181);
            webserver.RegisterController<MirrorWebServer>();

            await webserver.StartServerAsync();
        }
Beispiel #2
0
        private void InitializeWebServer()
        {
            _webserver = new RestWebServer();
            _webserver.RegisterController<ParametersController>();

            _webserver.StartServerAsync();
        }
Beispiel #3
0
        public async Task InitializeWebServer()
        {
            var webserver = new RestWebServer(8181);

            webserver.RegisterController <MirrorWebServer>();

            await webserver.StartServerAsync();
        }
Beispiel #4
0
        private async Task InitializeWebServer()
        {
            _webserver = new RestWebServer(8800, "api");

            _webserver.RegisterController <AsyncControllerSample>();
            _webserver.RegisterController <FromBodyControllerSample>();
            _webserver.RegisterController <PerCallControllerSample>();
            _webserver.RegisterController <SimpleParameterControllerSample>();
            _webserver.RegisterController <SingletonControllerSample>();
            _webserver.RegisterController <ThrowExceptionControllerSample>();
            _webserver.RegisterController <WithResponseBodyControllerSample>();

            await _webserver.StartServerAsync();
        }
Beispiel #5
0
        private async Task InitializeWebServer()
        {
            _webserver = new RestWebServer(8800, "api");

            _webserver.RegisterController<AsyncControllerSample>();
            _webserver.RegisterController<FromBodyControllerSample>();
            _webserver.RegisterController<PerCallControllerSample>();
            _webserver.RegisterController<SimpleParameterControllerSample>();
            _webserver.RegisterController<SingletonControllerSample>();
            _webserver.RegisterController<ThrowExceptionControllerSample>();
            _webserver.RegisterController<WithResponseBodyControllerSample>();

            await _webserver.StartServerAsync();
        }
Beispiel #6
0
        /// <remarks>
        /// If you start any asynchronous methods here, prevent the task
        /// from closing prematurely by using BackgroundTaskDeferral as
        /// described in http://aka.ms/backgroundtaskdeferral
        /// </remarks>
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            // This deferral should have an instance reference, if it doesn't... the GC will
            // come some day, see that this method is not active anymore and the local variable
            // should be removed. Which results in the application being closed.
            _deferral = taskInstance.GetDeferral();

            _webserver = new RestWebServer(8800, "api");

            _webserver.RegisterController<AsyncControllerSample>();
            _webserver.RegisterController<FromContentControllerSample>();
            _webserver.RegisterController<PerCallControllerSample>();
            _webserver.RegisterController<SimpleParameterControllerSample>();
            _webserver.RegisterController<SingletonControllerSample>();
            _webserver.RegisterController<ThrowExceptionControllerSample>();
            _webserver.RegisterController<WithResponseContentControllerSample>();

            await _webserver.StartServerAsync();

            // Dont release deferral, otherwise app will stop
        }