scottie1984 / swagger-ui-express

Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
MIT License
1.43k stars 226 forks source link

Cant load custom css/change icon #225

Closed cgd1 closed 2 years ago

cgd1 commented 4 years ago

Hello,

I'm trying to load custom css and logo with no luck.

const options = {
  customCss: '#header {display: none }',
  swaggerDefinition: {
    openapi: "3.0.3",
    info: {
      "title": "TITLE",
      "description": ".",
      "x-logo": {
        "url": "https://cdn.worldvectorlogo.com/logos/quartz.svg",
        "backgroundColor": "#FFFFFF"
      },
      "termsOfService": "/terms",
      "contact": {
        "name": "API Support",
        "url": "/support"
      },
      "license": {
        "name": "Home Page",
        "url": "/news"
      },
      "version": "v0.2a"  
    },
  },
 apis: ['../endpoints/*.js']
};

Not sure what I am doing wrong, any help would be greatly appreciated!

scottie1984 commented 3 years ago

Have you tried following the example in the docs? https://www.npmjs.com/package/swagger-ui-express#custom-css-styles

mahajanankur commented 3 years ago

Not working for me as well. I tried following the example but no luck.