node-red-contrib-route-parser 0.0.5

A node-red node for parsing pathparams in routes for RESTful Web Services.

npm install node-red-contrib-route-parser

node-red-contrib-route-parser

A node-red node for parsing pathparams in routes for RESTful Web Services.

Parse out pathparams from the route and return in an associative array.

Associative Array is stored in msg.req.route.params as key value pairs.

If the route was defined in a HTTP input node as:

/api/test/:lastname/:firstname/anything/:else/you/might/:route

and the actual request path is:

/api/test/Hill/Mike/anything/foo/you/might/bar

the parser would add key/value pairs based on path parameters that start with ":" in msg.req.route.params:

msg.req.route.params = {
    lastname : "Hill",
    firstname : "Mike",
    else : "foo",
    route : "bar"
}

Node Info

Version: 0.0.5
Updated 11 years, 9 months ago
License: Apache-2.0
Rating: not yet rated

Categories

Actions

Rate:

Downloads

3 in the last week

Nodes

  • route-parser

Keywords

  • node-red
  • router
  • pathparms
  • rest
  • webservices

Maintainers