Skip to content

Express oriented middleware which make the proxying simple with REST APIs.

License

Notifications You must be signed in to change notification settings

3imed-jaberi/rest-api-proxy-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST API Proxy Middleware

Express oriented middleware which make the proxying simple with REST APIs.

Built on top of native Node.js modules, without any dependencies.

Installation

# npm ..
$ npm install rest-api-proxy-middleware
# yarn ..
$ yarn add rest-api-proxy-middleware

Usage

This is a practical example of how to use.

const express = require('express');
const { restApiProxyMiddleware } = require ('rest-api-proxy-middleware');
const app = express();

const target = 'http://jsonplaceholder.typicode.com/todos/1';
app.use('/proxy-gateway', restApiProxyMiddleware({ target }));

// We have extra options can be passed like:
// - httpClient: help to replace the default native 'http' module with 'https'.
// - onError: help to handle the produced errors.
// We ship 'isURL' helper, which check if the passed string is a valid url or not!

License


MIT © Imed Jaberi

About

Express oriented middleware which make the proxying simple with REST APIs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published