How do you remove the metadata redirect in ServiceStack?

我的梦境 提交于 2019-12-10 17:57:16

问题


I have ServiceStack installed via NuGet, and I have added the following Config within SetConfig:

EnableFeatures = Feature.All.Remove(Feature.Metadata)

which has removed the physical page from /metadata however, each time I try to hit the root, I am still redirected to /metadata. I could not see anything else allowing me to handle this on the official page ( https://github.com/ServiceStack/ServiceStack/wiki/Metadata-page ) - any help would be highly appreciated!


回答1:


You can add your own Default.html/.cshtml/etc home page for your services or you can specify the in the DefaultRedirectPath or MetadataRedirectPath in the EndpointHostConfig.




回答2:


    SetConfig(new EndpointHostConfig {
        EnableFeatures = Feature.All
                                   .Remove(Feature.Metadata)
                                 //.Remove(Feature.PredefinedRoutes)
                                 //.Add(Feature.ProtoBuf)
                                 //... and more
                                   ,
        DefaultRedirectPath = "/default", //set default|index|home
      //... and more
    }); 


来源:https://stackoverflow.com/questions/12887034/how-do-you-remove-the-metadata-redirect-in-servicestack

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!