Example #1
0
 public HttpApiServer(HttpConfig serverConfig)
 {
     mActionFactory = new ActionHandlerFactory();
     if (serverConfig != null)
     {
         ServerConfig = serverConfig;
     }
     else
     {
         string configFile = "HttpConfig.json";
         if (System.IO.File.Exists(configFile))
         {
             using (System.IO.StreamReader reader = new StreamReader(configFile, Encoding.UTF8))
             {
                 string json = reader.ReadToEnd();
                 Newtonsoft.Json.Linq.JToken toke = (Newtonsoft.Json.Linq.JToken)Newtonsoft.Json.JsonConvert.DeserializeObject(json);
                 ServerConfig = toke["HttpConfig"].ToObject <HttpConfig>();
             }
         }
         else
         {
             ServerConfig = new HttpConfig();
         }
     }
     mResourceCenter = new StaticResurce.ResourceCenter(this);
     mUrlRewrite     = new RouteRewrite(this);
 }
Example #2
0
 public HttpApiServer(HttpOptions options)
 {
     mFileLog        = new FileLogWriter("BEETLEX_HTTP_SERVER");
     FrameSerializer = this;
     if (options != null)
     {
         Options = options;
     }
     else
     {
         Options = LoadOptions();
     }
     mActionFactory  = new ActionHandlerFactory(this);
     mResourceCenter = new StaticResurce.ResourceCenter(this);
     mUrlRewrite     = new RouteRewrite(this);
     mModuleManager  = new ModuleManager(this);
 }
Example #3
0
 public HttpApiServer(HttpConfig serverConfig)
 {
     mFileLog        = new FileLogWriter("BEETLEX_HTTP_SERVER");
     FrameSerializer = this;
     if (serverConfig != null)
     {
         ServerConfig = serverConfig;
     }
     else
     {
         ServerConfig = LoadConfig();
     }
     mActionFactory  = new ActionHandlerFactory(this);
     mResourceCenter = new StaticResurce.ResourceCenter(this);
     mUrlRewrite     = new RouteRewrite(this);
     mModuleManage   = new ModuleManage(this);
 }