Skip to content

emashiq/Swagger.Branding.Change.Sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swagger.Branding.Change.Sample

Active Static content use which will enable wwwroot

Startup.cs

app.UseStaticFiles();
app.UseSwaggerUI(c => {
    c.SwaggerEndpoint("/swagger/v1/swagger.json", "OTPZone v1");
    c.InjectStylesheet("/swagger-content/custom.css");
    c.InjectJavascript("/swagger-content/custom.js", "text/javascript");
    c.RoutePrefix = string.Empty;
});

custom.css

.swagger-ui .topbar {
    background: #4267B2;
}

custom.js

(function () {
    window.addEventListener("load", function () {
        setTimeout(function () {
            var logo = document.getElementsByClassName('link'); //For Changing The Link On The Logo Image
            logo[0].href = "https://otpzone.com";
            logo[0].target = "_blank";
            logo[0].children[0].alt = "OTPZone_API";
            logo[0].children[0].src = '/swagger-content/logo.png';
            var body = document.getElementsByName('body');
            console.log(body);
        });
    });
})();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published