The OpenD Programming Language

cgiMainImpl

This is the function GenericMain calls. View its source for some simple boilerplate you can copy/paste and modify, or you can call it yourself from your main.

Please note that this may spawn other helper processes that will call main again. It does this currently for the timer server and event source server (and the quasi-deprecated web socket server).

void
cgiMainImpl
(
alias fun
CustomCgi = Cgi
long maxContentLength = defaultMaxContentLength
)
(
string[] args
)
if (
is(CustomCgi : Cgi)
)

Parameters

fun

Your request handler

CustomCgi

a subclass of Cgi, if you wise to customize it further

maxContentLength

max POST size you want to allow

args string[]

command-line arguments

Meta

History

Documented Sept 26, 2020.