示例#1
0
        public static void Run(WebServer.WebServer server)
        {
            RegisterAssemblyName();


            try
            {
                server.Run();
            }
            catch (Exception ex)
            {
                Console.WriteLine($"{ex.Message} {ex.InnerException}");
            }
        }
示例#2
0
        public static void Run(WebServer.WebServer server)
        {
            RegisterAssemblyName();
            RegisterControllersData();
            RegisterViewsData();
            RegisterModelsData();

            try
            {
                server.Run();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
示例#3
0
        public static void Start(IMvcApplication application)
        {
            var container = new ServiceCollection();

            application.ConfigureServices(container);

            var controllerRouter = new ControllerRouter(container);
            var resourceRouter   = new ResourceRouter();
            var customRouter     = new CustomRouter();

            var router = new HttpHandlerContext(controllerRouter, resourceRouter, customRouter);

            application.Configure();

            var server = new WebServer.WebServer(HOSTING_PORT, router);

            server.Run();
        }
示例#4
0
        public static void runServer()
        {
            string srv;

            if (Config.LocalhostOnly)
            {
                srv = "localhost";
            }
            else
            {
                srv = "+";
            }
            WebServer.WebServer ws = new WebServer.WebServer(SendResponse, string.Format("http://{0}:{1}/", srv, Config.Port));
            ws.Run();

            Console.WriteLine("Akira webserver. Press any key to quit.");
            Console.ReadKey();

            ws.Stop();
        }