use env variables for config
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
9b0426f6c1
commit
b38edbaa26
|
@ -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}/`)
|
||||
|
|
Loading…
Reference in New Issue