| 
									
										
										
										
											2019-10-26 23:52:19 -06:00
										 |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-28 01:06:43 -06:00
										 |  |  | require("./") | 
					
						
							|  |  |  | 	.init(initialize) | 
					
						
							|  |  |  | 	.serve(worker) | 
					
						
							|  |  |  | 	.master(function() { | 
					
						
							|  |  |  | 		console.log("Hello from master"); | 
					
						
							|  |  |  | 	}); | 
					
						
							| 
									
										
										
										
											2019-10-26 23:52:19 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-28 01:06:43 -06:00
										 |  |  | function initialize() { | 
					
						
							|  |  |  | 	var pkg = require("./package.json"); | 
					
						
							|  |  |  | 	var config = { | 
					
						
							| 
									
										
										
										
											2019-10-29 06:53:19 +00:00
										 |  |  | 		package: { | 
					
						
							|  |  |  | 			name: "Greenlock_Express_Demo", | 
					
						
							|  |  |  | 			version: pkg.version, | 
					
						
							|  |  |  | 			author: pkg.author | 
					
						
							|  |  |  | 		}, | 
					
						
							| 
									
										
										
										
											2019-10-28 01:06:43 -06:00
										 |  |  | 		staging: true, | 
					
						
							| 
									
										
										
										
											2019-10-28 03:43:42 -06:00
										 |  |  | 		cluster: true, | 
					
						
							| 
									
										
										
										
											2019-10-26 23:52:19 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-28 03:43:42 -06:00
										 |  |  | 		notify: function(ev, params) { | 
					
						
							| 
									
										
										
										
											2019-10-29 06:48:31 +00:00
										 |  |  | 			console.info(ev, params); | 
					
						
							| 
									
										
										
										
											2019-10-28 03:43:42 -06:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2019-10-28 01:06:43 -06:00
										 |  |  | 	}; | 
					
						
							|  |  |  | 	return config; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-10-26 23:52:19 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-28 01:06:43 -06:00
										 |  |  | function worker(glx) { | 
					
						
							|  |  |  | 	console.info(); | 
					
						
							| 
									
										
										
										
											2019-10-28 03:43:42 -06:00
										 |  |  | 	console.info("Hello from worker #" + glx.id()); | 
					
						
							| 
									
										
										
										
											2019-10-26 23:52:19 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-28 01:06:43 -06:00
										 |  |  | 	glx.serveApp(function(req, res) { | 
					
						
							|  |  |  | 		res.end("Hello, Encrypted World!"); | 
					
						
							| 
									
										
										
										
											2019-10-26 23:52:19 -06:00
										 |  |  | 	}); | 
					
						
							| 
									
										
										
										
											2019-10-28 01:06:43 -06:00
										 |  |  | } |