express-cors-request-proxy
v1.0.0
Published
[Express](https://github.com/expressjs/express/) proxy using [request](https://github.com/request/request) to allow serverless single pages applications.
Downloads
5
Readme
express-cors-request-proxy
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..."
}