Esempio n. 1
0
        public static void ConfigureServiceHost <TServiceHost>(this ServiceStackHost appHost, bool debugEnabled)
            where TServiceHost : ServiceStackHost
        {
            appHost.SetConfig(new HostConfig
            {
                DebugMode                = debugEnabled,
                DefaultRedirectPath      = "/metadata",
                MapExceptionToStatusCode = SetupExceptionToStatusCodeMap()
            });

            appHost.Container.AddSingleton <IRecorder>(new Recorder <TServiceHost>());
            SetupExceptionShielding(appHost);
            SetupJsonResponses();
            appHost.RegisterService <HealthCheckService>();
        }