Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: heroku-devcent…
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 18 lines (15 sloc) 0.584 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package com.typesafe.webwords.common

/**
* This class represents our app configuration.
*/
case class WebWordsConfig(amqpURL: Option[String], mongoURL: Option[String], port: Option[Int])

object WebWordsConfig {
    def apply(): WebWordsConfig = {
        val amqpURL = Option(System.getenv("RABBITMQ_URL"))
        val mongoURL = Option(System.getenv("MONGOHQ_URL"))
        val port = Option(System.getenv("PORT")) map { s => Integer.parseInt(s) }
        val config = WebWordsConfig(amqpURL, mongoURL, port)
        println("Configuration is: " + config)
        config
    }
}
Something went wrong with that request. Please try again.