koa-better-http-proxy
koa-better-http-proxy copied to clipboard
What should I use width koa-mount ?
const proxy = require('koa-better-http-proxy');
const Koa = require('koa');
const http = require('http');
const mount = require('koa-mount');
var app = new Koa();
var proxyApp = proxy('127.0.0.1:8080');
var path = 'test1'
app.use(
mount(path, proxyApp)
)
server = http.createServer(app.callback());
server.listen(1234);
I want to be in port 1234 opening an proxy adopt port 1234/test1/ come to visit 127.0.0.1:8080 127.0.0.1:8080 has web I succeeded but All static resources All failed ... They request like 127.0.0.1:1234/js/main.js however correct url is like 127.0.0.1:1234/test1/js/main.js
I think of it 301 ...is work but so ugly...and when some request is post the lost... What should I do?