Make trust proxy option configurable

trust proxy option is now configurable via the TRUST_PROXY_IP
environment variable.
develop
Clemens Moritz 2 years ago
parent d8432315d5
commit c87e8ee70b

@ -4,11 +4,11 @@ import morgan from 'morgan';
import router from './router'; import router from './router';
import wxService from './services/wx.service'; import wxService from './services/wx.service';
const { PORT = 3000, BASE_PATH = '/api' } = process.env; const { PORT = 3000, BASE_PATH = '/api', TRUST_PROXY_IP = false } = process.env;
const app = express(); const app = express();
app.set('trust proxy', true); app.set('trust proxy', TRUST_PROXY_IP);
app.use(morgan('combined')); app.use(morgan('combined'));
app.use(BASE_PATH, router.router); app.use(BASE_PATH, router.router);

Loading…
Cancel
Save