This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Proxy to an HTTPS server using a PKCS12 client certificate | |
const fs = require('fs'); | |
const { createProxyMiddleware } = require('http-proxy-middleware'); | |
const apiProxy = createProxyMiddleware('/api', { | |
target: { | |
protocol: 'https:', | |
host: 'example.org', | |
port: 443, | |
pfx: fs.readFileSync('path/to/certificate.p12'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const sumObjs = (...objs) => Object.assign({}, | |
...objs.reduce((acc, obj) => Object.keys(obj).map((key) => { | |
const ret = {}; ret[key] = acc[key] + obj[key]; | |
return ret; | |
}))); |