Esempio n. 1
0
        static TestWebServer.HttpServer RunWebServer(int port)
        {
            var path   = typeof(Program).Assembly.Location.ToSPath().Parent.Combine("files");
            var server = new TestWebServer.HttpServer(path, port);
            var thread = new Thread(() =>
            {
                server.Start();
            });

            thread.Start();
            return(server);
        }
Esempio n. 2
0
        static void RunWebServer(SPath path, int port)
        {
            if (!path.IsInitialized)
            {
                path = typeof(Program).Assembly.Location.ToSPath().Parent.Combine("files");
            }

            var server = new TestWebServer.HttpServer(path, port);
            var thread = new Thread(() =>
            {
                Logger.Error($"Press any key to exit");
                server.Start();
            });

            thread.Start();
            Console.Read();
            server.Stop();
        }