1.0.0 • Published 5 years ago

express-cors-request-proxy v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

express-cors-request-proxy

Express proxy using request.

Hosted at

Package usage

Install

npm i express-cors-request-proxy

Start up server

require('express-cors-request-proxy').listen(process.env.PORT || 3000);

API usage

This API uses the library request options, so just send the options in the JSON body.

Default method is GET

Success response

{
 "url": "https://github.com/filipemeneses"
}

The response will be:

{
  "ok": true,
  "html": "\n\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>..."
}

You can use Cheerio to parse HTML to use as "jQuery-like"

Error response

If it fails it will print (consider invalid options):

{
  "method": "GET"
}

The response will return the stack:

{
  "ok": false,
  "error": "Error: options.uri is a required argument..."
}