/user

The _user module exports the user method to route User API requests.

  • add
  • admin
  • cookie
  • delete
  • key
  • list
  • log
  • login
  • register
  • token
  • update
  • verify

Requires

Methods

(inner) debounceRequest(req, res)

The remote_address determined from the request header is stored in the previousAddress module variable. Requests from the same address within 30 seconds will be bounced.

Parameters:
NameTypeDescription
reqreq

HTTP request.

resres

HTTP response.

Properties
NameTypeDescription
req.paramsObject

HTTP request parameter.

req.headerObject

HTTP request header.

(async, inner) user(req, res)

The Mapp API uses the user method to lookup and route User API requests.

The route method assigns the host param from /utils/reqHost before the request and response arguments are passed a User API method identified by the method param.

The method request parameter must be an own member of the methods object, eg. admin, register, verify, add, delete, update, list, log, key, token, cookie, or login.

Requests to the user module are debounced by 5 seconds preventing registration, login, etc in quick succession from the same IP address.

Parameters:
NameTypeDescription
reqObject

HTTP request.

resObject

HTTP response.

req.paramsObject

Request parameter.

Properties
NameTypeDescription
methodstring

Method request parameter.