Rob Gibbens
Rob Gibbens

Reputation: 1142

ServiceStack SwaggerUI route location

The documentation for ServiceStack's SwaggerUI implementation states

Default configuration expects that ServiceStack services are available under '/api' path.

but I have my api at the root. Is there a way to change where the SwaggerUI's looks?

Upvotes: 2

Views: 1446

Answers (1)

Rob Gibbens
Rob Gibbens

Reputation: 1142

I found /swagger-ui/index.html includes the JavaScript code containing the api location.

        window.swaggerUi = new SwaggerUi({
            discoveryUrl:'../api/resources',
            apiKey:"",
            dom_id:"swagger-ui-container",
            supportHeaderParams: false,
            supportedSubmitMethods: ['get', 'post', 'put']
        });

Change the discoveryUrl to be:

discoveryUrl:'../resources'

The Swagger-UI should then correctly auto-discover the available resources.

Upvotes: 3

Related Questions