Socket
Socket
Sign inDemoInstall

@types/swagger-ui-express

Package Overview
Dependencies
2
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/swagger-ui-express

TypeScript definitions for swagger-ui-express


Version published
Weekly downloads
355K
decreased by-15.67%
Maintainers
1
Created
Weekly downloads
 

Package description

What is @types/swagger-ui-express?

@types/swagger-ui-express provides TypeScript type definitions for the swagger-ui-express package, which is used to serve auto-generated Swagger API documentation from an Express.js server.

What are @types/swagger-ui-express's main functionalities?

Serve Swagger UI

This feature allows you to serve the Swagger UI documentation for your API. The code sets up an Express.js server and uses swagger-ui-express to serve the Swagger documentation at the /api-docs endpoint.

const express = require('express');
const swaggerUi = require('swagger-ui-express');
const swaggerDocument = require('./swagger.json');

const app = express();

app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));

app.listen(3000, () => {
  console.log('Server is running on http://localhost:3000');
});

Customizing Swagger UI

This feature allows you to customize the appearance and behavior of the Swagger UI. The code demonstrates how to hide the top bar and set a custom site title for the Swagger documentation.

const express = require('express');
const swaggerUi = require('swagger-ui-express');
const swaggerDocument = require('./swagger.json');

const options = {
  customCss: '.swagger-ui .topbar { display: none }',
  customSiteTitle: 'My API Docs'
};

const app = express();

app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument, options));

app.listen(3000, () => {
  console.log('Server is running on http://localhost:3000');
});

Other packages similar to @types/swagger-ui-express

Readme

Source

Installation

npm install --save @types/swagger-ui-express

Summary

This package contains type definitions for swagger-ui-express (https://github.com/scottie1984/swagger-ui-express).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/swagger-ui-express.

Additional Details

Credits

These definitions were written by Dmitry Rogozhny, and Florian Keller.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc