Skip to content

servicestack kestrel c# how can I hide/show endpoints in ui #138

Closed Answered by Davidilius
Davidilius asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks to all the right answer is:

public class AppHost : AppHostBase
{
public AppHost() : base("Your Service Name", typeof(AppHost).Assembly) { }

public override void Configure(Container container)
{
    var hideEndpoints = GetAppSettings().Get("HideEndpoints", false); // Read the configuration variable

    if (hideEndpoints)
    {
        typeof(YourServiceRequestDto)
            .AddAttributes(new ExcludeMetadataAttribute());
        // Add ExcludeMetadata attribute to other Request DTOs if needed
    }

    // Other configuration code...
}

}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@Davidilius
Comment options

@mythz
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Davidilius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants