コード例 #1
0
        public AppHostHttpListenerBase CreateHost(string serviceName = DefaultServiceName, Assembly serviceAssembly = null, Action<AppHostHttpListenerBase> configurationBuilder = null)
        {
            if (serviceAssembly == null)
                serviceAssembly = Assembly.GetCallingAssembly();

            var appHost = new ServiceStackAppHost(serviceName, serviceAssembly, configurationBuilder);
            appHost.Init();

            return appHost;
        }
コード例 #2
0
        public void StartHost(string urlBase, string serviceName = DefaultServiceName, Assembly serviceAssembly = null, Action<AppHostHttpListenerBase> configurationBuilder = null)
        {
            if (serviceAssembly == null)
                serviceAssembly = Assembly.GetCallingAssembly();

            var appHost = new ServiceStackAppHost(serviceName, serviceAssembly, configurationBuilder);
            appHost.Init();
            appHost.Start(urlBase);

            Console.WriteLine("Listening on {0}...", urlBase);
            Console.WriteLine("Press any key to stop.");
            Console.ReadLine();
        }
コード例 #3
0
        public AppHostHttpListenerBase CreateHost(string serviceName = DefaultServiceName, Assembly serviceAssembly = null, Action <AppHostHttpListenerBase> configurationBuilder = null)
        {
            if (serviceAssembly == null)
            {
                serviceAssembly = Assembly.GetCallingAssembly();
            }

            var appHost = new ServiceStackAppHost(serviceName, serviceAssembly, configurationBuilder);

            appHost.Init();

            return(appHost);
        }
コード例 #4
0
        public void StartHost(string urlBase, string serviceName = DefaultServiceName, Assembly serviceAssembly = null, Action <AppHostHttpListenerBase> configurationBuilder = null)
        {
            if (serviceAssembly == null)
            {
                serviceAssembly = Assembly.GetCallingAssembly();
            }

            var appHost = new ServiceStackAppHost(serviceName, serviceAssembly, configurationBuilder);

            appHost.Init();
            appHost.Start(urlBase);

            Console.WriteLine("Listening on {0}...", urlBase);
            Console.WriteLine("Press any key to stop.");
            Console.ReadLine();
        }