Uptooda Scripting API
Loading...
Searching...
No Matches
WebServer Class Reference

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

#include <WebServer.h>

Public Member Functions

int bind (int port)
 Bind a port. Pass 0 as argument to use random port.
int port () const
void resource (string path, string method, function callBack, object context)
 Register route handler.
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 Bound port

◆ resource()

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

Register route handler.

Parameters
pathregular expression
methodGET, POST, etc.
callBack
context