NameSummary
handle Registers a handler for the given path pattern.
listen Starts the HTTP server.
static Serves static files from a directory at the given route prefix.
fn handle(path, handler) -> null
Registers a handler for the given path pattern. Supports path parameters like /users/:id
Parameters
pathURL pattern (e.g. '/users/:id')
handlerFunction(req, res) or {GET: fn, POST: fn, ...}
Returns
null
fn listen(addr) -> null
Starts the HTTP server.
Parameters
addrAddress to listen on (e.g. ':8080')
Returns
null
fn static(route, directory) -> null
Serves static files from a directory at the given route prefix.
Parameters
routeURL prefix (e.g. '/static')
directoryLocal directory path (e.g. './public')
Returns
null