Capy-Bearer Documentation

server_start_http

lib call

Capy

function server_start_http(key : string, bind : string, file : string, callback : string = "") s64

Description

server_start_http() starts or updates a custom HTTP listener. The handler file must define SERVE_HTTP.

Parameters

key : listener key

bind : TCP port or Unix socket path

file : handler file path, relative to the calling unit or site root

callback : optional handler name

Return Values

The listener process ID, or 0.

Example

Capy

var pid := server_start_http("docs-server", "29994", "doc/examples/http_server.capy", "named")
print(pid > 0, "\n")

Output

true