예제 #1
0
파일: Program.cs 프로젝트: jkotas/corefxlab
        public static void Main(string[] args)
        {
            Console.WriteLine("Sample Rest Server Started");
            Console.WriteLine("The server implements /time REST method.");
            Console.WriteLine("Browse to http://<host>:8080/time or http://<host>:8080/plaintext to test it.\n");

            var log = new ConsoleLog((Log.Level.Error));
            var restServer = new SampleRestServer(log, 8080, 0, 0, 0, 0);
            restServer.StartAsync();

            Console.WriteLine("Press ENTER to exit ...");
            Console.ReadLine();

            restServer.Stop();
        }
예제 #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Sample Rest Server Started");
            Console.WriteLine("The server implements /time REST method.");
            Console.WriteLine("Browse to http://<host>:8080/time or http://<host>:8080/plaintext to test it.\n");

            var log        = new ConsoleLog((Log.Level.Error));
            var restServer = new SampleRestServer(log, 8080, 0, 0, 0, 0);

            restServer.StartAsync();

            Console.WriteLine("Press ENTER to exit ...");
            Console.ReadLine();

            restServer.Stop();
        }
예제 #3
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Sample Rest Server Started");
            Console.WriteLine("Browse to http://<host>:8080/time, http://<host>:8080/plaintext, or http://<host>:8080/json to test it.\n");

            var log          = new ConsoleLog((Log.Level.Verbose));
            var cancellation = new CancellationTokenSource();

            var restServer = new SampleRestServer(cancellation.Token, log, 8080, 0, 0, 0, 0);

            restServer.StartAsync();

            Console.WriteLine("Press ENTER to exit ...");
            Console.ReadLine();

            cancellation.Cancel();
        }