Example #1
0
File: Program.cs Project: 20chan/lp
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("usage: pgom.lightpost {auth}");
                return;
            }
            var post    = new LPServer("posts.db", args[0]);
            var statics = new StaticsServer("statics", "index.html");

            var server = new RouteServer(port: 4001);

            server.AppendRoutes(post, "lp");
            server.AppendRoutes(statics, "lp");

            StartDaemon(server);
        }
Example #2
0
 public RouteServerTest()
 {
     server = new TestServer();
     runner = new RouteServer(port: port);
     runner.AppendRoutes(server);
     runner.HandleErrorToConsole = false;
     runner.StartAsync();
 }
Example #3
0
        static void Main(string[] args)
        {
            var simul    = new SimulationServer(typeof(ExampleGame));
            var frontend = new FrontEndServer("FrontEnd", "index.html");

            var server = new RouteServer <SimulationServer>(simul);

            server.AppendRoutes(frontend);
            var waiter = new ManualResetEvent(false);

            Console.CancelKeyPress += (o, e) => {
                e.Cancel = true;
                waiter.Set();
            };

            server.StartAsync();
            Console.WriteLine("tart started.. press ctrl+c to stop");

            waiter.WaitOne();
            server.Stop();
        }