Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

swagger-tools app not logging http requests to console #619

Open
ctippur opened this issue Apr 15, 2020 · 0 comments
Open

swagger-tools app not logging http requests to console #619

ctippur opened this issue Apr 15, 2020 · 0 comments

Comments

@ctippur
Copy link

ctippur commented Apr 15, 2020

Hello,

I am using swagger-tools/middleware. I would like to see the http request to be logged to console. Wondering how to do this effectively?

Here is my middleware code:

// Initialize the Swagger middleware
swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) {
  
    // Route validated requests to appropriate controller
    app.use(middleware.swaggerRouter(options));
    
  // Serve the Swagger documents and Swagger UI
  app.use(middleware.swaggerUi());

  // Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain
  app.use(middleware.swaggerMetadata());

  // Validate Swagger requests
  app.use(middleware.swaggerValidator());

  // Use security
  app.use(middleware.swaggerSecurity({
    Bearer: auth.verifyToken
  }));

Thanks
S

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant