Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  docs
  src
  package.json
  .babelrc
  .editorconfig
  .env-example
  .eslintignore
  .eslintrc
  .prettierignore
  .prettierrc
  .yarnrc
  .yo-rc.json
  checkstyle.xml
  gulpfile.js
  Jenkinsfile
  jest.config.js
  junit.xml
  README.md
  yarn.lock
Size: Mime:
  README.md

@doodle/proxy

Run locally

yarn
yarn build
cd dist/
yarn link
// then cd into the project where you wanna use it and:
yarn link "@doodle/proxy"

Test

yarn lint
yarn test --watch

Usage in other node backends

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.