api_server/lib/api_server/api_request.js
// suit a specialized application ... in general this structure should work very well for the vast majority of requests
suit a specialized application ... in general this structure should work very well for the vast majority of requests
suit a specialized application ... in general this structure should work very well for the vast majority of requests
_setRequestPhases () {
		this.REQUEST_PHASES = [
			'initialize',
			'authorize',
			'process',
			'persist',
			'handleResponse',
			'postProcess',
			'postProcessPersist',
			'cleanup',
			'close'
		];
		this.RESPONSE_PHASE = 'handleResponse';
	}
_setRequestPhases ( ) { this . REQUEST_PHASES = [ 'initialize' , 'authorize' , 'process' , 'persist' , 'handleResponse' , 'postProcess' , 'postProcessPersist' , 'cleanup' , 'close' ] ; this . RESPONSE_PHASE = 'handleResponse' ; }
suit a specialized application ... in general this structure should work very well for the vast majority of requests
suit a specialized application ... in general this structure should work very well for the vast majority of requests
// initializion of data // a priori authorization of the request (ACL) // process the request, this is the meat of it // any changes are written to the database here // send the response back to the client // do any post-processing, meaning any processing of the request that goes on after the response is sent back to the client // perform any additional persistence to the database, same as persist but here it is recognized that we have already sent // a response to the client // final cleanup // close the request // This indicates the phase that handles a response, this phase will get executed regardless of the output of other phases