diff --git a/.env.example b/.env.example index 270b5d3..d25ac6b 100644 --- a/.env.example +++ b/.env.example @@ -9,3 +9,7 @@ ADMIN_EMAIL=john.doe@example.com SESSION_SECRET= SESSION_MEMCACHE_HOST=memcache:11211 + +RATE_LIMIT= + +TRUST_PROXY= \ No newline at end of file diff --git a/index.js b/index.js index 67e003a..18c3cbf 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,10 @@ const app = express(); const routes = require('./routes'); const middleware = require('./middleware'); +if (process.env.TRUST_PROXY != undefined) { + app.enable('trust proxy', '*'); +} + app.use(middleware); app.use(routes); app.use(express.static('public'));