Internal function to add middleware

add_middleware(jug, func, path = NULL, method = NULL, websocket = FALSE)

Arguments

jug

the jug instance

func

the function to bind

path

the path to bind to

method

the method to bind to

websocket

should the middleware bind to the websocket protocol