Browse Source

proxy path fix

master
Lloyd Brookes 9 years ago
parent
commit
b42e5f3918
  1. 5
      lib/local-web-server.js

5
lib/local-web-server.js

@ -1,5 +1,7 @@
'use strict'
const path = require('path')
const http = require('http')
const url = require('url')
const Koa = require('koa')
const serve = require('koa-static')
const convert = require('koa-convert')
@ -14,7 +16,6 @@ const _ = require('koa-route')
const mount = require('koa-mount')
const httpProxy = require('http-proxy')
const pathToRegexp = require('path-to-regexp')
const http = require('http')
/**
* @module local-web-server
@ -61,7 +62,7 @@ function getApp (options) {
.replace(re.index, arguments[index] || '')
})
proxy.once('proxyReq', function (proxyReq) {
proxyReq.path = route.new;
proxyReq.path = url.parse(route.new).path;
})
proxy.web(this.req, this.res, { target: route.new })
}))

Loading…
Cancel
Save