示例#1
0
        public static void Main()
        {
            HostFactory.Run(x =>
            {
                x.Service <NancySelfHost>(s =>
                {
                    s.ConstructUsing(name => new NancySelfHost());
                    s.WhenStarted(tc => tc.Start());
                    s.WhenStopped(tc => tc.Stop());
                });

                x.RunAsLocalSystem();
                x.SetDescription("Nancy-SelfHost service for FonixTalk");
                x.SetDisplayName(ServiceConfig.GetServiceDisplayName());
                x.SetServiceName(ServiceConfig.GetServiceName());
            });
        }
 public void Start()
 {
     m_nancyHost = new NancyHost(ServiceConfig.GetUris());
     m_nancyHost.Start();
 }