Repository URL to install this package:
|
Version:
1.0.0 ▾
|
yarn yarn build cd dist/ yarn link // then cd into the project where you wanna use it and: yarn link "@doodle/proxy"
yarn lint yarn test --watch
const proxyMiddleware = require('@doodle/proxy'); (...) server.use('/oab', proxyMiddleware({ target: yourDestinationURLHost, parseJSON: true }));
Depending on the flags you supply to it, it will return 1 (the proxy itself) or more middlewares.
For instance, when passing parseJSON it will also add the bodyparser.json() middleware before the proxy one.