mirror of
				https://github.com/therootcompany/greenlock-express.js.git
				synced 2024-11-16 17:28:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			36 lines
		
	
	
		
			720 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			720 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| "use strict";
 | |
| 
 | |
| require("./")
 | |
|     .init(initialize)
 | |
|     .serve(worker)
 | |
|     .master(function() {
 | |
|         console.log("Hello from master");
 | |
|     });
 | |
| 
 | |
| function initialize() {
 | |
|     var pkg = require("./package.json");
 | |
|     var config = {
 | |
|         package: {
 | |
|             name: "Greenlock_Express_Demo",
 | |
|             version: pkg.version,
 | |
|             author: pkg.author
 | |
|         },
 | |
|         staging: true,
 | |
|         cluster: true,
 | |
| 
 | |
|         notify: function(ev, params) {
 | |
|             console.info(ev, params);
 | |
|         }
 | |
|     };
 | |
|     return config;
 | |
| }
 | |
| 
 | |
| function worker(glx) {
 | |
|     console.info();
 | |
|     console.info("Hello from worker #" + glx.id());
 | |
| 
 | |
|     glx.serveApp(function(req, res) {
 | |
|         res.end("Hello, Encrypted World!");
 | |
|     });
 | |
| }
 |