temp-server
Serve specific route with specific content.
Last updated 4 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install temp-server 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.0                                ...           latest (4 years ago)

1 Versions

  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dev Dependencies (1)
  • xo latest
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |