uniquelyparticular / micro-requestbin

A Particularly minimal HTTP requestbin to support logging request header and body for secured/whitelisted referrers.

Home Page:https://uniquelyparticular.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@particular./micro-requestbin

npm version semantic-release code style: prettier CircleCI dependency status: david

RequestBin implementation to log output of incoming requests

Built with Micro! 🀩

πŸ›  Setup

Create a .env at the project root with the following credentials:

REQUESTBIN_ORIGIN_WHITELIST=*.mysite.com,*.mycrmplaform.io,*.mycommerceplaform.com,*.now.sh

REQUESTBIN_ORIGIN_WHITELIST is a comma separated list of patterns to match against the incoming requests 'Origin' header (ex. localhost,*.myawesomesite.com,*.now.sh)

Optional Additional Parameters

REQUESTBIN_SECRET_HEADER=x-webhook-secret-key
REQUESTBIN_SECRET_VALUE=zxasda

REQUESTBIN_SECRET_HEADER will default to 'x-webhook-secret-key' and is if a header is found that matches it to verify that the value sent matches anything you've specified as REQUESTBIN_SECRET_VALUE

πŸ“¦ Package

Run the following command to build the app

yarn install

Start the development server

yarn dev

The server will typically start on PORT 3000, if not, make a note for the next step.

Start ngrok (change ngrok port below from 3000 if yarn dev deployed locally on different port above)

ngrok http 3000

Make a note of the https ngrok URL provided.

πŸš€ Deploy

You can easily deploy this function to now.

Contact Adam Grohs @ Particular. for any questions.

About

A Particularly minimal HTTP requestbin to support logging request header and body for secured/whitelisted referrers.

https://uniquelyparticular.com

License:MIT License


Languages

Language:JavaScript 100.0%