Exemple #1
0
        static void Main(string[] args)
        {
            mApiServer = new BeetleX.FastHttpApi.HttpApiServer();

            mApiServer.Register(typeof(BeetleX.FastHttpApi.Admin._Admin).Assembly);
            mApiServer.Register(typeof(Program).Assembly);

            mApiServer.Options.UrlIgnoreCase = true;
            mApiServer.Open();
            Console.Write(mApiServer.BaseServer);
            Console.Read();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            mApiServer = new BeetleX.FastHttpApi.HttpApiServer();
            mApiServer.Debug();
            mApiServer.Register(typeof(BeetleX.FastHttpApi.Admin._Admin).Assembly);
            mApiServer.Register(typeof(Program).Assembly);
            mApiServer.HttpRequestNotfound += (o, e) =>
            {
                BeetleX.FastHttpApi.Move302Result result = new BeetleX.FastHttpApi.Move302Result("/_admin/index.html");
                e.Response.Result(result);
                e.Cancel = true;
            };

            mApiServer.Open();
            Console.Write(mApiServer.BaseServer);
            Console.Read();
        }
Exemple #3
0
 static void Main(string[] args)
 {
     mApiServer = new BeetleX.FastHttpApi.HttpApiServer();
     mApiServer.Register(typeof(Program).Assembly);
     mApiServer.ServerConfig.BodySerializer = new BeetleX.FastHttpApi.JsonBodySerializer();
     mApiServer.Open();
     Console.Read();
 }
Exemple #4
0
 static void Main(string[] args)
 {
     mApiServer = new BeetleX.FastHttpApi.HttpApiServer();
     mApiServer.Register(typeof(Program).Assembly);
     mApiServer.Open();
     Console.Write(mApiServer.BaseServer);
     Console.Read();
 }
Exemple #5
0
        static void Main(string[] args)
        {
            mApiServer = new BeetleX.FastHttpApi.HttpApiServer();

            mApiServer.Options.AddFilter <GlobalFilter>();
            mApiServer.Register(typeof(Program).Assembly);
            mApiServer.Open();
            Console.Read();
        }
Exemple #6
0
 static void Main(string[] args)
 {
     mApiServer = new BeetleX.FastHttpApi.HttpApiServer();
     mApiServer.ServerConfig.LogToConsole = true;
     mApiServer.ServerConfig.LogLevel     = BeetleX.EventArgs.LogType.Info;
     mApiServer.Register(typeof(Program).Assembly);
     mApiServer.Open();
     Console.Write(mApiServer.BaseServer);
     Console.Read();
 }
Exemple #7
0
 static void Main(string[] args)
 {
     mApiServer = new BeetleX.FastHttpApi.HttpApiServer();
     mApiServer.Register(typeof(Program).Assembly);
     //config.SSL = true;
     //mApiServer.ServerConfig.CertificateFile = @"c:\ssltest.pfx";
     //mApiServer.ServerConfig.CertificatePassword = "******";
     mApiServer.Debug();
     mApiServer.Open();
     Console.Write(mApiServer.BaseServer);
     Console.Read();
 }
Exemple #8
0
 public Server()
 {
     mApiServer = new BeetleX.FastHttpApi.HttpApiServer();
     //mApiServer.Options.LogLevel = BeetleX.EventArgs.LogType.All;
     mApiServer.Options.LogLevel     = BeetleX.EventArgs.LogType.Warring;
     mApiServer.Options.LogToConsole = true;
     //mApiServer.Options.SetDebug(); //set view path with vs project folder
     mApiServer.Register(typeof(Server).Assembly);
     mApiServer.Options.Port = 8889; //set listen port to 80
     mApiServer.Open();              //default listen port 9090
     Console.Write(mApiServer.BaseServer);
     Console.Read();
 }
Exemple #9
0
 public Task OpenServer()
 {
     mApiServer = new BeetleX.FastHttpApi.HttpApiServer(new BeetleX.FastHttpApi.HttpOptions()
     {
         Port                = ConfigSettings.Instance.Port,
         LogLevel            = BeetleX.EventArgs.LogType.Warring,
         Manager             = ConfigSettings.Instance.Manager,
         ManagerPWD          = ConfigSettings.Instance.ManagerPWD,
         SSL                 = ConfigSettings.Instance.UseSSL,
         CertificateFile     = ConfigSettings.Instance.SSLPath,
         CertificatePassword = ConfigSettings.Instance.SSLPwd,
         WriteLog            = true,
         LogToConsole        = true,
         SSLPort             = ConfigSettings.Instance.SSLPort,
         WebSocketMaxRPS     = 100000000
     });
     mApiServer.Debug();
     mApiServer.Register(typeof(BeetleX.FastHttpApi.Admin._Admin).Assembly);
     mApiServer.Register(typeof(Program).Assembly);
     mApiServer.Open();
     Console.Write(mApiServer.BaseServer);
     Console.Read();
     return(Task.CompletedTask);
 }
Exemple #10
0
 static void Main(string[] args)
 {
     mApiServer = new BeetleX.FastHttpApi.HttpApiServer();
     mApiServer.Debug();
     mApiServer.Register(typeof(Program).Assembly);
     mApiServer.Open();
     mApiServer.WebSocketReceive = (o, e) =>
     {
         Console.WriteLine(e.Frame.Body);
         var freame = e.CreateFrame($"{DateTime.Now}" + e.Frame.Body.ToString());
         e.Response(freame);
     };
     Console.Write(mApiServer.BaseServer);
     Console.Read();
 }