mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 11:34:04 +00:00 
			
		
		
		
	Add proxy support
This commit is contained in:
		@@ -20,6 +20,7 @@ export interface Configuration {
 | 
				
			|||||||
	storageURL : string,
 | 
						storageURL : string,
 | 
				
			||||||
	storagePath : string,
 | 
						storagePath : string,
 | 
				
			||||||
	database : DatabaseConfiguration,
 | 
						database : DatabaseConfiguration,
 | 
				
			||||||
 | 
						proxy ?: string
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class ConfigurationHelper {
 | 
					export class ConfigurationHelper {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,12 @@ async function init() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	app.use(fileUpload());
 | 
						app.use(fileUpload());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Check if the server is running behing a proxy
 | 
				
			||||||
 | 
						if(conf().proxy) {
 | 
				
			||||||
 | 
							console.info("Running behind proxy: " + conf().proxy);
 | 
				
			||||||
 | 
							app.set("trust proxy", conf().proxy);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Process the list of routes
 | 
						// Process the list of routes
 | 
				
			||||||
	Routes.forEach(route => {
 | 
						Routes.forEach(route => {
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user