forked from cory/tildefriends
		
	core: Don't actually start the http server unless we've specified a port or are asking for a port to be determined and written to file.
This commit is contained in:
		
							
								
								
									
										36
									
								
								core/core.js
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								core/core.js
									
									
									
									
									
								
							@@ -844,23 +844,25 @@ loadSettings()
 | 
			
		||||
			httpd.set_http_redirect(settings.http_redirect);
 | 
			
		||||
		}
 | 
			
		||||
		httpd.all('/app/socket', app.socket);
 | 
			
		||||
		let port = httpd.start(tildefriends.http_port);
 | 
			
		||||
		if (tildefriends.args.out_http_port_file) {
 | 
			
		||||
			print('Writing the port file.');
 | 
			
		||||
			File.writeFile(
 | 
			
		||||
				tildefriends.args.out_http_port_file,
 | 
			
		||||
				port.toString() + '\n'
 | 
			
		||||
			)
 | 
			
		||||
				.then(function (r) {
 | 
			
		||||
					print(
 | 
			
		||||
						'Wrote the port file:',
 | 
			
		||||
						tildefriends.args.out_http_port_file,
 | 
			
		||||
						r
 | 
			
		||||
					);
 | 
			
		||||
				})
 | 
			
		||||
				.catch(function () {
 | 
			
		||||
					print('Failed to write the port file.');
 | 
			
		||||
				});
 | 
			
		||||
		if (tildefriends.http_port > 0 || tildefriends.args.out_http_port_file) {
 | 
			
		||||
			let port = httpd.start(tildefriends.http_port);
 | 
			
		||||
			if (tildefriends.args.out_http_port_file) {
 | 
			
		||||
				print('Writing the port file.');
 | 
			
		||||
				File.writeFile(
 | 
			
		||||
					tildefriends.args.out_http_port_file,
 | 
			
		||||
					port.toString() + '\n'
 | 
			
		||||
				)
 | 
			
		||||
					.then(function (r) {
 | 
			
		||||
						print(
 | 
			
		||||
							'Wrote the port file:',
 | 
			
		||||
							tildefriends.args.out_http_port_file,
 | 
			
		||||
							r
 | 
			
		||||
						);
 | 
			
		||||
					})
 | 
			
		||||
					.catch(function () {
 | 
			
		||||
						print('Failed to write the port file.');
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (tildefriends.https_port) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user