Skip to content

Commit

Permalink
refactor: simplify (#2120)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored and evilebottnawi committed Jul 30, 2019
1 parent cfbf229 commit 18edd18
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/Server.js
Expand Up @@ -280,14 +280,12 @@ class Server {
* ]
*/
this.options.proxy.forEach((proxyConfigOrCallback) => {
let proxyConfig;
let proxyMiddleware;

if (typeof proxyConfigOrCallback === 'function') {
proxyConfig = proxyConfigOrCallback();
} else {
proxyConfig = proxyConfigOrCallback;
}
let proxyConfig =
typeof proxyConfigOrCallback === 'function'
? proxyConfigOrCallback()
: proxyConfigOrCallback;

proxyMiddleware = getProxyMiddleware(proxyConfig);

Expand Down

0 comments on commit 18edd18

Please sign in to comment.