1.0.0 • Published 7 years ago
koa-forwarding v1.0.0
KOA_FORWARDING
Install
npm install koa-forwarding
yarn add koa-forwarding
Usage
import Koa from 'koa';
import forwarding from 'koa-forwarding';
const app = new Koa();
const HOST = '0.0.0.0';
const PORT = 8080;
app
.use(forwarding({
host: 'miaooo.me',
match: /\/st.*/,
map: p => `/perfix/${p}`,
}))
.listen(PORT, HOST);
// 0.0.0.0:8080/static => miaooo.me/perfix/static
// 0.0.0.0:8080/ts => 404
See also
- koajs/mount Mount
koa-forwarding
to a specific path