/user
path.EffectFactory
HTTP route builder does not exists anymore. Please user.pipe
builder instead.r.pipe
is an indexed monad builder used for collecting information about Marble REST route details, like: path, request method type, middlewares and connected Effect.combineRoutes
function, which combines routing for a prefixed path passed as a first argument. Exported group of Effects can be combined with other Effects like in the example below.combineRoutes()
function.req.body
object containing the parsed data will be populated on the request object after the middleware, or undefined if there was no body to parse, the Content-Type
was not matched, or an error occurred. To learn more about body parsing middleware visit the @marblejs/middleware-body API specification.req.body
object are untrusted and should be validated before usage.req.body, req.params, req.query
are of type unknown
. In order to work with decoded values you should validate them before (e.g. using dedicated validator middleware) or explicitly assert attributes to the given type. We highly recommend to use the @marblejs/middlware-io package which allows you to properly infer the type of validated properties.combineRoutes
function and the r.matchPath
allows you to define parameters in the path argument. All parameters are defined by the syntax with a colon prefix.req.params
property. If there are no decoded URL parameters then the property contains an empty object. For the above example and route /bob/12
the req.params
object will contain the following properties:req.params
object are untrusted and should be validated before usage.*
) to denote a zero or more parameter matches. The code snippet below shows an example use case of a "zero-or-more" parameter. For example, it can be useful for defining routing for static assets.req.query
property. If there are no decoded query parameters then the property contains an empty object. For parsing and decoding query parameters, Marble.js makes use of qs
library.req.query
object are untrusted and should be validated before usage.