express-cors-request-proxy

1.0.0 • Public • Published

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..."
}

Readme

Keywords

none

Package Sidebar

Install

npm i express-cors-request-proxy

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

4.04 kB

Total Files

7

Last publish

Collaborators

  • filipemeneses