.nh .TH "Caddy" "8" "Apr 2023" "Auto generated by spf13/cobra" "" .SH NAME .PP caddy-respond - Simple, hard-coded HTTP responses for development and testing .SH SYNOPSIS .PP \fBcaddy respond [flags]\fP .SH DESCRIPTION .PP Spins up a quick-and-clean HTTP server for development and testing purposes. .PP With no options specified, this command listens on a random available port and answers HTTP requests with an empty 200 response. The listen address can be customized with the --listen flag and will always be printed to stdout. If the listen address includes a port range, multiple servers will be started. .PP If a final, unnamed argument is given, it will be treated as a status code (same as the --status flag) if it is a 3-digit number. Otherwise, it is used as the response body (same as the --body flag). The --status and --body flags will always override this argument (for example, to write a body that literally says "404" but with a status code of 200, do '--status 200 404'). .PP A body may be given in 3 ways: a flag, a final (and unnamed) argument to the command, or piped to stdin (if flag and argument are unset). Limited template evaluation is supported on the body, with the following variables: .PP .RS .nf {{.N}} The server number (useful if using a port range) {{.Port}} The listener port {{.Address}} The listener address .fi .RE .PP (See the docs for the text/template package in the Go standard library for information about using templates: https://pkg.go.dev/text/template) .PP Access/request logging and more verbose debug logging can also be enabled. .PP Response headers may be added using the --header flag for each header field. .SH OPTIONS .PP \fB--access-log\fP[=false] Enable the access log .PP \fB--body\fP="" The body of the HTTP response .PP \fB--debug\fP[=false] Enable more verbose debug-level logging .PP \fB--header\fP=[] Set a header on the response (format: "Field: value" .PP \fB-h\fP, \fB--help\fP[=false] help for respond .PP \fB--listen\fP=":0" The address to which to bind the listener .PP \fB--status\fP=200 The response status code .SH SEE ALSO .PP \fBcaddy(8)\fP .SH HISTORY .PP 17-Apr-2023 Auto generated by spf13/cobra