proxy-nest
v1.0.0
Published
ProxyNest is a lightweight Node.js package that simplifies the creation of a proxy server using Axios. It acts as an intermediary, forwarding requests from clients to specified APIs and returning the responses. With built-in support for error handling, re
Downloads
14
Readme
const createProxyServer = require('proxy-nest');
createProxyServer({ port: 8485, sslOptions: { key: fs.readFileSync('path/to/private.key', 'utf8'), cert: fs.readFileSync('path/to/certificate.crt', 'utf8'), ca: [fs.readFileSync('path/to/ca_bundle.crt', 'utf8')] }, corsOptions: { origin: ['https://example.com', 'http://localhost:4200'], methods: 'GET,POST', }, allowedReferers: [ 'https://api.example.com', 'http://localhost:4200', 'https://uat.example.com', 'https://example.com' ], targetUrl: 'https://devapi.nishant.com' // Custom target URL (mandatory) });