diff --git a/src/index.js b/src/index.js index 79aedaa..4989959 100644 --- a/src/index.js +++ b/src/index.js @@ -6,9 +6,9 @@ import Counter from './counter' import Redis from 'async-redis' /* DEFAULTS */ -const REDIS_HOST = 'localhost' -const REDIS_PORT = 6379 -const LISTEN_PORT = 3000 +const REDIS_HOST = process.env.REDIS_HOST || 'localhost' +const REDIS_PORT = process.env.REDIS_PORT || 6379 +const LISTEN_PORT = process.env.LISTEN_PORT || 3000 const app = new Koa() const router = new Router() @@ -29,4 +29,5 @@ app.use(JSON({pretty: true})) .use(router.allowedMethods()) app.listen(LISTEN_PORT) +console.log(`Redis connection: ${REDIS_HOST}:${REDIS_PORT}`) console.log(`Started at: http://localhost:${LISTEN_PORT}/`)