Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Middleware

Middleware class


Description

A Middleware object represents middleware functions that have access to the request (req), response (res) and error (err) objects in request-response cycle via the Router.

Methods

path

Returns the path for the specified middleware.

FUN

Returns the function response.

method

Returns the HTTP method for the middleware, i.e. "GET", "POST", etc.

protocol

Returns the protocol, "http" or "websocket".

initialize(FUN, path, method, websocket)

Initializes the state of new middleware.

Methods

Public methods


Method new()

Usage
Middleware$new(FUN, path, method, websocket)

Method clone()

The objects of this class are cloneable with this method.

Usage
Middleware$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also


beakr

A Minimalist Web Framework for R

v0.4.3
GPL-3
Authors
Hans Martin [aut], Jonathan Callahan [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.