Skip to main content
Version: Next

Output: http-server

Run HTTP server

Example

Pipe Language Snippet:

http-server:
address: http://httpbin.org/get

Field Summary

Field NameTypeDescriptionDefault
addressstringBind address-
pathstringUrl path on which to accept queries/
content-typestringContent type to return with response-
certpathPath to the TLS certificate to be used (TLS requires both cert and key to be valid)-
keypathPath to the TLS private to be used (TLS requires both cert and key to be valid)-
bodytemplated textAllows specifying exactly what is returned-

Fields

address

Type: string

Bind address

Example

Pipe Language Snippet:

http-server:
address: 127.0.0.1:8000

path

Type: string

Default: /

Url path on which to accept queries

Example

Pipe Language Snippet:

http-server:
address: 127.0.0.1:8000
path: /foo/bar

content-type

Type: string

Content type to return with response

Example

Pipe Language Snippet:

http-server:
address: 127.0.0.1:8000
content-type: application/text
body: some text

cert

Type: path

Path to the TLS certificate to be used (TLS requires both cert and key to be valid)

Example

Pipe Language Snippet:

http-server:
address: 0.0.0.0:8000
cert: /etc/letsencrypt/live/your.domain.io/fullchain.pem
key: /etc/letsencrypt/live/your.domain.io/privkey.pem

key

Type: path

Path to the TLS private to be used (TLS requires both cert and key to be valid)

body

Type: templated text

Allows specifying exactly what is returned

When not specified, the body returned is the whole event. May contain event field expansions.

Example

Pipe Language Snippet:

http-server:
body: '${_raw}'
address: 127.0.0.1:8000