Example #1
0
        public static void Main()
        {
            var server = new WebServer.WebServer(8888, new ControllerRouter(), new ResourceRouter());
            var db     = new TicketSystemContext();

            MvcEngine.Run(server, db);
        }
        public static void Main(string[] args)
        {
            var server = new WebServer.WebServer(1337, new ControllerRouter());

            var db = new SimpleMvcDbContext();

            db.Database.EnsureCreated();

            MvcEngine.Run(server);
        }
Example #3
0
        private static void Main(string[] args)
        {
            using (var db = new NotesDbContext())
            {
                db.Database.EnsureCreated();
            }

            var server = new WebServer.WebServer(8000, new ControllerRouter());

            MvcEngine.Run(server);
        }
Example #4
0
 /// <summary>
 /// Initialize MainForm
 /// </summary>
 /// <param name="webServer">The WebServer</param>
 public MainForm(WebServer.WebServer webServer, Services.IImportService importService) : this()
 {
     try
     {
         _webServer     = webServer;
         _importService = importService;
     }
     catch (Exception caught)
     {
         logger.Error("Unexpected Error Initailizing MainForm", caught);
         throw;
     }
 }
Example #5
0
        static void Main(string[] args)
        {
            Console.WriteLine("Initializing database...");

            using (var context = new SimpleMvcDbContext())
            {
                context.Database.Migrate();
            }

            var server = new WebServer.WebServer(8000, new ControllerRouter());

            MvcEngine.Run(server);
        }
Example #6
0
        public static void Run(WebServer.WebServer server)
        {
            RegisterAssemblyName();


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

            try
            {
                server.Run();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Example #8
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();
        }
Example #9
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();
        }
Example #10
0
        public Program()
        {
            "started".Trace();
            GameServer.Database db = (GameServer.Database)_XmlSerializer.Deserialize(File.Open(Settings._Maps, FileMode.Open));
            List<GameServer.Server> svrs = new List<GameServer.Server>();
            foreach(Task task in db._tasks)
            {
                GameServer.Server _Server = new GameServer.Server();
                _Server._Task = task;
                _Server.StartAsync();
                svrs.Add(_Server);
            }

            PolicyServer ps = new PolicyServer { policyFile = "Server/PolicyFile.xml" };
            ps.StartAsync();

            WebServer.WebServer _WebServer = new WebServer.WebServer();
            _WebServer.StartAsync();
            Thread.Sleep(-1);
        }
Example #11
0
 /// <summary>
 /// Initialize Agent ApplicationContext
 /// </summary>
 public AgentApplicationContext()
 {
     try
     {
         _kernel    = InitializeContainer();
         _baseUrl   = GetWebServerBaseUrl();
         _webServer = new WebServer.WebServer(_baseUrl);
         var importService = _kernel.Get <Services.IImportService>();
         MainForm = new MainForm(_webServer, importService);
     }
     catch (Exception caught)
     {
         logger.Fatal("Unable to Initialize Application Context", caught);
         MessageBox.Show("An unexpected error has occurred while trying to start " +
                         "the Crown of the Gods Data Collection Agent.  It is recommended to " +
                         "review the log files for more information.",
                         "Crown of the Gods - Agent Fatal Startup Error",
                         MessageBoxButtons.OK,
                         MessageBoxIcon.Error,
                         MessageBoxDefaultButton.Button1);
         Environment.FailFast("Unable to start!", caught);
     }
 }
Example #12
0
        public Program()
        {
            "started".Trace();
            GameServer.Database      db   = (GameServer.Database)_XmlSerializer.Deserialize(File.Open(Settings._Maps, FileMode.Open));
            List <GameServer.Server> svrs = new List <GameServer.Server>();

            foreach (Task task in db._tasks)
            {
                GameServer.Server _Server = new GameServer.Server();
                _Server._Task = task;
                _Server.StartAsync();
                svrs.Add(_Server);
            }

            PolicyServer ps = new PolicyServer {
                policyFile = "Server/PolicyFile.xml"
            };

            ps.StartAsync();

            WebServer.WebServer _WebServer = new WebServer.WebServer();
            _WebServer.StartAsync();
            Thread.Sleep(-1);
        }
Example #13
0
        public static void Main()
        {
            var server = new WebServer(8000, new ControllerRouter(), new ResourceRouter());

            MvcEngine.Run(server);
        }
Example #14
0
        static void Main(string[] args)
        {
            var server = new WebServer.WebServer(1337, new ControllerRouter(), new ResourceRouter());

            MvcEngine.Run(server, new KittenDbContext());
        }
Example #15
0
        static void Main()
        {
            var server = new WebServer.WebServer(1337, new ControllerRouter(), new ResourceRouter());

            MvcEngine.Run(server, new MeTubeDbContext());
        }