I'm currently looking at the Razor Rockstars example project on github, to try and grasp how ServiceStack V4 and Razor is glued together.
I am specifically struggling with the following piece of code in the SS Razor demo:
SetConfig(new EndpointHostConfig {
CustomHttpHandlers = {
{ HttpStatusCode.NotFound, new RazorHandler("/notfound") },
{ HttpStatusCode.Unauthorized, new RazorHandler("/login") },
}
});
I know from the docs that EndpointHostConfig is now simply HostConfig, but I can't seem to locate the CustomHttpHandlers in the Service Stack V4 release notes. Is there something obvious I'm missing?
Thanks in advance.
The HostConfig is limited to configuration, in v4 most of the handlers that used to be in the Config have been moved to the AppHost, e.g:
this.CustomErrorHttpHandlers[HttpStatusCode.NotFound] = new RazorHandler("/notfound");
this.CustomErrorHttpHandlers[HttpStatusCode.Unauthorized] = new RazorHandler("/login");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With