Capy-Bearer Documentation

server_start_http

host 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

callback : optional handler name

Return Values

The listener process ID, or 0.

Example

Capy

var pid := server_start_http("docs-server", "29994", "servers/http.capy", "named")
print(pid, "\n")