1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-24 14:29:23 +00:00

Add proxy support

This commit is contained in:
Pierre HUBERT 2020-03-30 16:07:17 +02:00
parent 69a3d7ed5b
commit 1a6cbf6dcb
2 changed files with 7 additions and 0 deletions

View File

@ -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 {

View File

@ -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 => {