Skip to content

Commit

Permalink
feat: Add proxy error console log.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 11, 2020
1 parent f7c8dcb commit 1c5b969
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ export default function (app: Application, watchFile: string | string[], conf: M
});

const proxyHTTP = httpProxy.createProxyServer({});
proxyHTTP.on('error', (err) => {
console.error(`${color.red_b.black(` Proxy Failed: ${err.name}`)} ${err.message || ''} ${err.stack || ''} !!`);
});
Object.keys(proxyListeners).forEach(event => {
proxyHTTP.on(event, proxyListeners[event]);
});
Expand Down

0 comments on commit 1c5b969

Please sign in to comment.