Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.9KB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940
  1. [![Build Status](https://secure.travis-ci.org/andrewrk/node-proxy-middleware.png)](http://travis-ci.org/andrewrk/node-proxy-middleware)
  2. ### Usage:
  3. ```js
  4. var connect = require('connect');
  5. var url = require('url');
  6. var proxy = require('proxy-middleware');
  7. var app = connect();
  8. app.use('/api', proxy(url.parse('https://example.com/endpoint')));
  9. // now requests to '/api/x/y/z' are proxied to 'https://example.com/endpoint/x/y/z'
  10. //same as example above but also uses a short hand string only parameter
  11. app.use('/api-string-only', proxy('https://example.com/endpoint'));
  12. ```
  13. ### Documentation:
  14. `proxyMiddleware(options)`
  15. `options` allows any options that are permitted on the [`http`](http://nodejs.org/api/http.html#http_http_request_options_callback) or [`https`](http://nodejs.org/api/https.html#https_https_request_options_callback) request options.
  16. Other options:
  17. - `route`: you can pass the route for connect middleware within the options, as well.
  18. - `via`: by default no [via header](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.45) is added. If you pass `true` for this option the local hostname will be used for the via header. You can also pass a string for this option in which case that will be used for the via header.
  19. - `cookieRewrite`: this option can be used to support cookies via the proxy by rewriting the cookie domain to that of the proxy server. By default cookie domains are not rewritten. The `cookieRewrite` option works as the `via` option - if you pass `true` the local hostname will be used, and if you pass a string that will be used as the rewritten cookie domain.
  20. - `preserveHost`: When enabled, this option will pass the Host: line from the incoming request to the proxied host. Default: `false`.
  21. ### Usage with route:
  22. ```js
  23. var proxyOptions = url.parse('https://example.com/endpoint');
  24. proxyOptions.route = '/api';
  25. var middleWares = [proxy(proxyOptions) /*, ...*/];
  26. // Grunt connect uses this method
  27. connect(middleWares);
  28. ```