Exemple #1
0
        static void Main(string[] args)
        {
            WebAppMap.AddDirectory();
            WebServer server = new WebServer();

            server.Run();
        }
Exemple #2
0
        public void Run()
        {
            Console.WriteLine("write calculator or cake: ");

            while (true)
            {
                var choose = Console.ReadLine();

                if (choose == "cake")
                {
                    var mainApplication = new ByTheCakeApplication();
                    var appRouteConfig  = new AppRouteConfig();
                    mainApplication.Start(appRouteConfig);
                    var webServer = new WebServer(1337, appRouteConfig);
                    webServer.Run();
                    break;
                }
                else if (choose == "calculator")
                {
                    var mainApplication = new MainApplication();
                    var appRouteConfig  = new AppRouteConfig();
                    mainApplication.Start(appRouteConfig);
                    var webServer = new WebServer(1337, appRouteConfig);
                    webServer.Run();
                    break;
                }
                else
                {
                    Console.WriteLine("write calculator or cake: ");
                }
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            var webServer = new WebServer("http://localhost:1234/");

            webServer.Run();
            Console.WriteLine("Press key to finish!");
            webServer.Stop();
        }
        private static void Main(string[] _)
        {
            var webServer = new WebServer($"http://localhost:{WebServer.PortNumber}/");

            webServer.Run();

            Console.ReadKey();
            webServer.StopListening();
        }
Exemple #5
0
        public void RunTest1()
        {
            WebServer ws = new WebServer(SendResponse, "http://localhost:8080/test/");

            ws.Run();
            Console.WriteLine("A simple webserver. Press a key to quit.");
            Console.ReadKey();
            ws.Stop();
        }
        // This is part of the server code, and shows you your server is running and gives you a way to easily stop it.
        private static void Main(string[] args)
        {
            var ws = new WebServer(SendResponse, "http://localhost:8080/test/");

            ws.Run();
            Console.WriteLine("A simple webserver. Press a key to quit.");
            Console.ReadKey();
            ws.Stop();
        }
Exemple #7
0
        static void Main(string[] args)
        {
            var ws = new WebServer(SendResponse, "http://localhost:8080/headers/");

            ws.Run();
            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
            ws.Stop();
        }
Exemple #8
0
        static void Main(string[] args)
        {
            var mainApplication = new MainApplication();

            var appRouteConfig = new AppRouteConfig();

            mainApplication.Start(appRouteConfig);
            var webServer = new WebServer(1337, appRouteConfig);

            webServer.Run();
        }
Exemple #9
0
        public void Run()
        {
            var mainApp     = new MainApplication();
            var routeConfig = new AppRouteConfig();

            mainApp.Configure(routeConfig);

            var webServer = new WebServer(1337, routeConfig);

            webServer.Run();
        }
Exemple #10
0
        public void Run()
        {
            var mainApplication = new ByTheCakeApplication();

            var appRouteConfig = new AppRouteConfig();

            mainApplication.Start(appRouteConfig);
            var webServer = new WebServer(1337, appRouteConfig);

            webServer.Run();
        }
        public void Run()
        {
            var mainApplication = new MainApplication();
            var appRouteConfig  = new AppRouteConfig();

            mainApplication.Configure(appRouteConfig);

            var webServer = new WebServer(Port, appRouteConfig);

            webServer.Run();
        }
Exemple #12
0
        public void Run()
        {
            ByTheCakeApp   mainApplication = new ByTheCakeApp();
            AppRouteConfig appRouteConfig  = new AppRouteConfig();

            mainApplication.Configure(appRouteConfig);

            WebServer webServer = new WebServer(Port, appRouteConfig);

            webServer.Run();
        }
Exemple #13
0
        public void Run()
        {
            var mainApplication = new GameStoreApplication();

            mainApplication.InitializeDatabase();
            var appRouteConfig = new AppRouteConfig();

            mainApplication.Configure(appRouteConfig);
            var webServer = new WebServer(1337, appRouteConfig);

            webServer.Run();
        }
Exemple #14
0
        private static void Main(string[] args)
        {
            List <string> listUrls = new List <string>();

            listUrls.Add("http://localhost:4000/login/");
            listUrls.Add("http://localhost:4000/FetchTwitterFeed/");

            var ws = new WebServer(SendResponse, listUrls.ToArray());

            ws.Run();
            Console.WriteLine("A simple webserver. Press a key to quit.");
            Console.ReadKey();
            ws.Stop();
        }
Exemple #15
0
        public void Run()
        {
            //ByTheCakeApp mainApplication = new ByTheCakeApp();
            GameStoreApp mainApplication = new GameStoreApp();

            mainApplication.InitializeDatabase();

            AppRouteConfig appRouteConfig = new AppRouteConfig();

            mainApplication.Configure(appRouteConfig);

            WebServer webServer = new WebServer(Port, appRouteConfig);

            webServer.Run();
        }
Exemple #16
0
        public void Run()
        {
            //var mainApplication = new MainApplication();

            var mainApplication = new ByTheCakeApp();

            mainApplication.InitializeDatabase();

            var appRouteConfig = new AppRouteConfig();

            mainApplication.Configure(appRouteConfig);

            var webServer = new WebServer(Port, appRouteConfig);

            webServer.Run();
        }
Exemple #17
0
        public void Run()
        {
            // NOTE: To Start working with your DB - put '.' in the connection string
            // instead of my DB server address !!!

            var mainApplication = new ByTheCakeApp();

            mainApplication.InitializeDatabase();

            var appRouteConfig = new AppRouteConfig();

            mainApplication.Configure(appRouteConfig);

            var webServer = new WebServer(Port, appRouteConfig);

            webServer.Run();
        }
Exemple #18
0
        static void Main(string[] args)
        {
            var options = new Options();

            if (Parser.Default.ParseArguments(args, options))
            {
                var root = options.Root;
                if (!Directory.Exists(root))
                {
                    Logger.Log(
                        Resources.InvalidPathMessage);
                }
                else
                {
                    var port      = options.Port;
                    var isVerbose = options.Verbose;
                    var webServer = new WebServer.WebServer(root, port, isVerbose);
                    webServer.Run();
                    Console.ReadKey();
                    webServer.Stop();
                }
            }
        }