我在没有 IIS 的独立模式下将 ServiceStack 用于我的自定义服务。
我想为我的服务添加文档/metadata
。我想试试 Swagger 插件。
我已将插件命令添加到我的配置中
public override void Configure(Funq.Container container)
{
SetConfig(new EndpointHostConfig()
{
DefaultRedirectPath = "index.html",
DebugMode = true,
WriteErrorsToResponse = true,
CustomHttpHandlers =
{
{ HttpStatusCode.Unauthorized, new AuthorizationErrorHandler() },
{ HttpStatusCode.Forbidden, new AuthorizationErrorHandler() },
{ HttpStatusCode.NotFound, new AuthorizationErrorHandler() }
}
});
// For automatic generation of documentation to APIs
Plugins.Add(new SwaggerFeature());
}
现有服务继续工作,但尝试访问
/swagger-ui/index.html
给出未找到的错误。是否有其他步骤未明确记录在
https://github.com/ServiceStack/ServiceStack/wiki/Swagger-API
我必须自己实际设置此页面吗?如果是这样,怎么做?