Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve debug logging #123

Closed
chimurai opened this issue Oct 25, 2016 · 1 comment
Closed

Improve debug logging #123

chimurai opened this issue Oct 25, 2016 · 1 comment

Comments

@chimurai
Copy link
Owner

Current debug logging doesn't take into account the http-proxy options:

  • prependPath (default: true)
  • ignorePath (default: false)

Example:

The following setup will prepend the target's path to the proxy path, when target is configured with a path; i.e. "http://localhost:8080**/api**". Since prependPath defaults to true

proxy('/api', {target: 'http://localhost:8080/api', logLevel: 'debug'});

// Current
// [HPM] Proxy created: /api  ->  http://localhost:8080/api
// [HPM] GET /api/users/123 -> http://localhost:8080/api

// Expected
// [HPM] Proxy created: /api  ->  http://localhost:8080/api/api
// [HPM] GET /api/users/123 -> http://localhost:8080/api/api/users/123
@chimurai
Copy link
Owner Author

Fixed in 3.0.0-beta

https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/logger.md

Additionally add environment variable to see verbose logging DEBUG=http-proxy-middleware*

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

No branches or pull requests

1 participant