AppRoomServer

controllers/arserver~ AppRoomServer

new AppRoomServer()

Source:

The main class representing the server system that sets up the web server and handles all requests.

Methods

(async) emergencyAlert(eventType, subject, message, express, extraData, flagAlsoSendToSecondaries)

Source:

This may be called on serious errors (server down, database offline, unexpected exception, etc.), when we want to alert admin(s) immediately via email or sms It does some rate-limiting to prevent generating too many messages, etc.

Parameters:
Name Type Description
eventType string
subject string
message string
express req

request (or null if not part of one)

extraData object
flagAlsoSendToSecondaries boolean

if false, only the main admin is notified; if true then the primary AND secondary list of emails, etc. is notified

Returns:

number of messages sent

(async) makeSecureTokenAccess(userPassport, user, scope)

Source:

Helper function to make a generic secure token

Parameters:
Name Type Description
userPassport Object

minimal object with properties of the user

user UserModel

full model object of User class

scope String

the refresh token object to use to generate access token

Returns:

a token object

(async) makeSecureTokenAccessFromRefreshToken(userPassport, user, refreshToken)

Source:

Helper function to make a secure access token from a refresh token

Parameters:
Name Type Description
userPassport Object

minimal object with properties of the user

user UserModel

full model object of User class

refreshToken String

the refresh token object to use to generate access token

Returns:

a token object.

(async) makeSecureTokenRefresh(userPassport, user)

Source:

Helper function to make a Refresh token

Parameters:
Name Type Description
userPassport Object

minimal object with properties of the user

user UserModel

full model object of User class

Returns:

a token object