1.1.2 • Published 10 years ago

anyurlhttpserver v1.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

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'.
    -v, --version        Display anyurlhttpserver version.
    -h, --help           Output usage information.

  Parameters with * can be used more than once.
1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago