public virtual Task StartAsync(CancellationToken cancellationToken) { mApiServer = new HttpApiServer(); mApiServer.Debug(); mApiServer.Options.WebSocketMaxRPS = 100; mApiServer.Register(typeof(Program).Assembly); mApiServer.Register(typeof(_Admin).Assembly); mApiServer.Open(); return(Task.CompletedTask); }
static void Main(string[] args) { mApiServer = new HttpApiServer(); mApiServer.Register(typeof(Program).Assembly);//加载程序集中所有控制器信息和静态资源信息 mApiServer.Options.Port = 9090; mApiServer.Options.LogLevel = BeetleX.EventArgs.LogType.Warring; mApiServer.Options.LogToConsole = true; mApiServer.Debug();//只有在Debug模式下生产,把静态资源加载目录指向项目的views目录 mApiServer.Open(); Console.Write(mApiServer.BaseServer); Console.Read(); }
static void Main(string[] args) { mApiServer = new HttpApiServer(); mApiServer.Options.LogToConsole = true; mApiServer.Options.LogLevel = BeetleX.EventArgs.LogType.Debug; mApiServer.Debug(); mApiServer.Register(typeof(Program).Assembly); mApiServer.Open(); Console.Write(mApiServer.BaseServer); Console.WriteLine(Environment.ProcessorCount); Console.Read(); }
public virtual Task StartAsync(CancellationToken cancellationToken) { mApiServer = new HttpApiServer(); DBModules.DBHelper.Default.GetSequence("System"); ES.ESHelper.Init(DBModules.DBHelper.Default.Setting.ElasticSearch.Value); mApiServer.Debug(); mApiServer.Register(typeof(Program).Assembly); mApiServer.Open(); ES.ESHelper.SyncData(mApiServer); JWTHelper.Init(); return(Task.CompletedTask); }