Home Contents | # http.new | Httpd | Core4 Lua Event System

## SYNOPSIS

httpd = http.new(app [, path])

## DESCRIPTION

This function creates a new web server instance. The server is attached to the event processor passed in app.

By default, the server will serve files from the directory /usr/lib/htdocs. The optional parameter path can be used to chose a different server root.

Initially the server is dormant. To enable it, call httpd:listen() or httpd:secureListen().

## RETURN VALUE

A web server instance.

## NOTES

Traditionally, the variable used to hold the web server is called httpd.

## EXAMPLE

>
httpd = http.new(app)

## SEE ALSO

httpd:close(), httpd:listen(), httpd:secureListen(), httpd:setMaxMemory(), httpd:setPath()