mirror of
				https://github.com/therootcompany/greenlock-express.js.git
				synced 2024-11-16 17:28:59 +00:00 
			
		
		
		
	improve style
This commit is contained in:
		
							parent
							
								
									39d9ae4f31
								
							
						
					
					
						commit
						8c25386767
					
				
							
								
								
									
										16
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								index.js
									
									
									
									
									
								
							| @ -93,11 +93,14 @@ module.exports.create = function (opts) { | |||||||
|     return promise; |     return promise; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   // NOTE: 'greenlock' is just 'opts' renamed
 | ||||||
|   var greenlock = require('greenlock').create(opts); |   var greenlock = require('greenlock').create(opts); | ||||||
| 
 | 
 | ||||||
|   opts.app = opts.app || function (req, res) { |   if (!opts.app) { | ||||||
|     res.end("Hello, World!\nWith Love,\nGreenlock for Express.js"); |     opts.app = function (req, res) { | ||||||
|   }; |       res.end("Hello, World!\nWith Love,\nGreenlock for Express.js"); | ||||||
|  |     }; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   opts.listen = function (plainPort, port, fnPlain, fn) { |   opts.listen = function (plainPort, port, fnPlain, fn) { | ||||||
|     var promises = []; |     var promises = []; | ||||||
| @ -135,7 +138,12 @@ module.exports.create = function (opts) { | |||||||
|     server.unencrypted = plainServer; |     server.unencrypted = plainServer; | ||||||
|     return server; |     return server; | ||||||
|   }; |   }; | ||||||
| 
 |   opts.middleware.acme = function (opts) { | ||||||
|  |     return greenlock.middleware.sanitizeHost(greenlock.middleware(require('redirect-https')(opts))); | ||||||
|  |   }; | ||||||
|  |   opts.middleware.secure = function (app) { | ||||||
|  |     return greenlock.middleware.sanitizeHost(app); | ||||||
|  |   }; | ||||||
| 
 | 
 | ||||||
|   return greenlock; |   return greenlock; | ||||||
| }; | }; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user