New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/swagger-ui-express

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/swagger-ui-express

TypeScript definitions for swagger-ui-express

  • 4.1.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
656K
increased by5.6%
Maintainers
1
Weekly downloads
 
Created

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

FAQs

Package last updated on 29 Oct 2024

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc