overwolf.web.webserver

An instance of a web server.

Methods

listen(callback)

Version added: 0.93.1

Listens for requests on the given port. If the port is already in use, or this instance is already listening, an error will be returned.

  • Parameter: callback <function>

    Fired with the status of the request.

Callback argument:
{
    "status": "success",
    "url": "http://localhost:7707/"
}

close()

Version added: 0.93.1

Closes the web server. It can be re-opened again.

Events How to use events

onRequest

Version added: 0.93.1

Fired when the web server receives an incoming request. The event contains three strings: ‘url’, ‘content’ and ‘contentType’.