Image Uploader Scripting API
Public Member Functions | List of all members
WebServer Class Reference

Start a web server listening a port on 127.0.0.1. More...

Public Member Functions

int bind (int port)
 Bind a port. Pass 0 as argument to use random port. More...
 
int port () const
 
void resource (string path, string method, function callBack, object context)
 Register route handler. More...
 
void start ()
 
void stop ()
 

Detailed Description

Start a web server listening a port on 127.0.0.1.

Since
version 1.3.3

Member Function Documentation

◆ bind()

int bind ( int  port)

Bind a port. Pass 0 as argument to use random port.

Parameters
port
Returns
int Binded port

◆ resource()

void resource ( string   path,
string   method,
function  callBack,
object  context 
)

Register route handler.

Parameters
pathregular expression
methodGET, POST, etc.
callBack
context