@betterthings/proxy

simple proxy for local development

no longer maintained
Last updated 2 years ago by lusbuab .
MIT · Original npm · Tarball · package.json
$ cnpm install @betterthings/proxy 
SYNC missed versions from official npm registry.

Proxy

npm version

Usage

const fs = require('fs')
const path = require('path')
const startServers = require('@betterthings/proxy')

const config = {
  SKIN_A: {
    port: 9001,
    ssl: {
      cert: fs.readFileSync(path.resolve(__dirname, 'cert.pem')),
      key: fs.readFileSync(path.resolve(__dirname, 'key.pem')),
    },
    proxy: {
      host: 'localhost:5000',
      headers: {
        'X-SKIN': 'A',
      },
    },
  },
  SKIN_B: {
    port: 9002,
    ssl: {
      cert: fs.readFileSync(path.resolve(__dirname, 'cert.pem')),
      key: fs.readFileSync(path.resolve(__dirname, 'key.pem')),
    },
    proxy: {
      host: 'localhost:5000',
      headers: {
        'X-SKIN': 'B',
      },
    },
  },
  DEV_API: {
    port: 9100,
    proxy: {
      host: 'api.dev.example.com',
      auth: {
        user: 'knockknock',
        password: 'whosthere',
      },
    },
  },
}

startServers(config)

Authors

Current Tags

  • 0.0.2                                ...           latest (2 years ago)

3 Versions

  • 0.0.2 [deprecated]           ...           2 years ago
  • 0.0.1 [deprecated]           ...           2 years ago
  • 0.0.0 [deprecated]           ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 3
Last Month 7
Dependencies (2)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |