temp-server

0.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i temp-server

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • kchan