|
@ -88,6 +88,7 @@ function localWebServer (options) { |
|
|
if (options.rewrite && options.rewrite.length) { |
|
|
if (options.rewrite && options.rewrite.length) { |
|
|
options.rewrite.forEach(route => { |
|
|
options.rewrite.forEach(route => { |
|
|
if (route.to) { |
|
|
if (route.to) { |
|
|
|
|
|
/* `to` address is remote if the url specifies a host */ |
|
|
if (url.parse(route.to).host) { |
|
|
if (url.parse(route.to).host) { |
|
|
debug('proxy rewrite', `${route.from} -> ${route.to}`) |
|
|
debug('proxy rewrite', `${route.from} -> ${route.to}`) |
|
|
app.use(_.all(route.from, mw.proxyRequest(route, app))) |
|
|
app.use(_.all(route.from, mw.proxyRequest(route, app))) |
|
|