Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        public static void ServeServiceTypes(string contentRoot, HostPrefix[] prefixes, ServiceRegistry registry = null, params Type[] serviceTypes)
        {
            BamConf conf = BamConf.Load(contentRoot.Or(defaultContentRoot));

            if (registry != null && ServiceRegistry.Default == null)
            {
                ServiceRegistry.Default = registry;
            }
            glooServer = new GlooServer(conf, GetLogger(), GetArgument("verbose", "Log responses to the console?").IsAffirmative())
            {
                HostPrefixes       = new HashSet <HostPrefix>(prefixes),
                MonitorDirectories = new string[] { }
            };
            serviceTypes.Each(t => glooServer.ServiceTypes.Add(t));

            glooServer.Start();
        }