Class: WebServer

WebServer

new WebServer(inRequestListener)

Web server for node. Implements support for POST on top of the regular incoming-request class.
Parameters:
Name Type Description
inRequestListener function function to call with request when complete
Source:

Methods

listen(inPort)

Listen for requests.
Parameters:
Name Type Description
inPort integer port on which to listen, eg 80 for HTTP
Source:

on(inEventName, inEventHandler)

Dispatch event handler assignments. This class stands in for the regular server class, so we have to proxy the setting of various event handlers. Check for setting the request event handler, as we will call that when WE think the request is complete, ie once we've checked for POST, etc. Forward on any other event handler assignments to our server instance.
Parameters:
Name Type Description
inEventName string name of event, eg request
inEventHandler function event handler function
Source:

onRequest(inRequest, outResponse)

Handle incoming HTTP requests. This implementation extends the regular Node http package by supporting POST.
Parameters:
Name Type Description
inRequest object HTTP request
outResponse object HTTP response
Source:

stop()

Stop serving requests.
Source: