No description, website, or topics provided.
JavaScript
Latest commit 1e43032 Dec 8, 2016 @subwiz subwiz committed on GitHub Merge pull request #2 from raghu12133/master
Added ngrok support
Permalink
Failed to load latest commit information.
.gitignore initial commit Apr 30, 2016
README.md Added ngrok support Dec 8, 2016
index.js Added ngrok support Dec 8, 2016
package.json Added ngrok support Dec 8, 2016

README.md

Any Url Http Server

A HTTP server that responds with the content of the input file, irrespective of what path / method is requested. Can be used for quickly mocking a API response for dev / testing purposes.

Install

npm install anyurlhttpserver -g

Run

anyurlhttpserver -p 3000 -f a.json

When the above command is executed, any URL that is hit at http://localhost:3000/* will serve the contents of a.json for all HTTP methods. To see help:

  $ anyurlhttpserver -h

  anyurlhttpserver: Serve one file for any url path / method.

  Usage: anyurlhttpserver [options]

  Options:

    -p, --port           [Mandatory] Port to listen.
    -f, --file           File to serve. When not given, serves content '{"hello": "world"}'.
    -c, --content-type   Response content type. Default is 'application/json'.
    -C, --cors           Add CORS headers to response. Optional Allow-Origin URL as param. Default is '*'.
    -H, --header         * Response header in the format 'header:value'.
    -s, --status-code    Response status code. Default is '200'.
    -n, --ngrok          Provides an ngrok tunnel url for the running server.
    -v, --version        Display anyurlhttpserver version.
    -h, --help           Output usage information.

  Parameters with * can be used more than once.