cgiMainImpl

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

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).

Parameters

funYour request handler
CustomCgia subclass of Cgi, if you wise to customize it further
maxContentLengthmax POST size you want to allow
argscommand-line arguments

History

Documented Sept 26, 2020.