Example #1
0
        static void Main(string[] args)
        {
            if (ApiConfig.IsDev)
            {
                using (WebApp.Start <Startup>(url: ApiConfig.WebApiHost))
                {
                    WebApiService webApiServer = new WebApiService();
                    webApiServer.CheckIndex();
                    webApiServer.CacheLanguageAllTexts();

                    Console.WriteLine("服务已经启动......");
                    Console.ReadLine();
                }
            }
            else
            {
                var servicesToRun = new ServiceBase[]
                {
                    new WebApiService()
                };
                ServiceBase.Run(servicesToRun);
            }
        }