예제 #1
0
        public static void StartTrooServer(ConsoleLogger logger, IRepository repo)
        {
            BamConf conf = BamConf.Load(DefaultConfiguration.GetAppSetting(contentRootConfigKey).Or(defaultContentRoot));

            trooServer = new TrooServer(conf, logger, repo)
            {
                HostPrefixes       = new HashSet <HostPrefix>(HostPrefix.FromDefaultConfiguration()),
                MonitorDirectories = DefaultConfiguration.GetAppSetting("MonitorDirectories").DelimitSplit(",", ";")
            };
            trooServer.Start();
        }
예제 #2
0
        public static void StartGlooServer(ConsoleLogger logger)
        {
            BamConf conf = BamConf.Load(DefaultConfiguration.GetAppSetting(contentRootConfigKey).Or(defaultContentRoot));

            glooServer = new GlooServer(conf, logger, GetArgument("verbose", "Log responses to the console?").IsAffirmative())
            {
                HostPrefixes       = new HashSet <HostPrefix>(HostPrefix.FromDefaultConfiguration("localhost", 9100)),
                MonitorDirectories = DefaultConfiguration.GetAppSetting("MonitorDirectories").DelimitSplit(",", ";")
            };
            glooServer.Start();
        }
예제 #3
0
        public static void StartVyooServer(ConsoleLogger logger)
        {
            DataSettings.Current.SetDefaultDatabaseFor <Session>(out Database userDb);
            userDb.TryEnsureSchema <Session>();
            DataSettings.Current.SetDefaultDatabaseFor <SecureSession>(out Database sessionDb);
            sessionDb.TryEnsureSchema <SecureSession>();
            BamConf conf = BamConf.Load(DefaultConfiguration.GetAppSetting(contentRootConfigKey).Or(defaultRoot));

            AppConf[] appConfigs = conf.AppConfigs;

            List <HostPrefix> hostPrefixes        = new List <HostPrefix>(HostPrefix.FromDefaultConfiguration("localhost", 7400));
            string            hostAppMapsFilePath = Path.Combine(conf.ContentRoot, "apps", hostAppMapsFileName);

            if (File.Exists(hostAppMapsFilePath))
            {
                HostAppMap[] hostAppMaps = HostAppMap.Load(hostAppMapsFilePath);
                if (Arguments.Contains("apps"))
                {
                    string[] appNamesToServe = Arguments["apps"].DelimitSplit(",", ";");
                    appConfigs = conf.AppConfigs.Where(ac => ac.Name.In(appNamesToServe)).ToArray();
                    hostPrefixes.AddRange(hostAppMaps.Where(ham => ham.AppName.In(appNamesToServe)).Select(ham => new HostPrefix {
                        HostName = ham.Host, Port = 80
                    }).ToArray());
                }
                else
                {
                    hostPrefixes.AddRange(HostPrefix.FromHostAppMaps(hostAppMaps));
                }
            }

            vyooServer = new VyooServer(appConfigs, logger, GetArgument("verbose", "Log responses to the console?").IsAffirmative())
            {
                HostPrefixes       = new HashSet <HostPrefix>(hostPrefixes),
                MonitorDirectories = DefaultConfiguration.GetAppSetting("MonitorDirectories").DelimitSplit(",", ";")
            };
            vyooServer.Start();
        }