0.1.0 • Published 8 years ago

temp-server v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

temp-server NPM version NPM downloads

Serve specific route with specific content.

Install

$ npm install -g temp-server

Usage

# interactive mode
$ temp-server

# arguments mode
$ temp-server --port 3000 --body "hello {{params.name}}" --url "/:name"

Use Case

Verify LetsEncrypt domain:

$ temp-server
> this.body = i9fh5Ik4Vkjzerr...long...hash
> options.url = /.well-known/acme-challenge/i9fh5Ip...long...hash
> options.port = 4000

API

const tempServer = require('temp-server')

tempServer(options)

tempServer(options)

options

url

Type: string Default: /

A router fragment, like /a/b/c or /foo/:name

port

Type: number Default: 4000

Server port

body

Type: string Default: hello world

The content to be print.

License

MIT © EGOIST