Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ss-6: small changes and hide twitter secrets
- Loading branch information
Showing
4 changed files
with
32 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,28 @@ | ||
package com.drwal.utils | ||
|
||
import com.typesafe.config.{Config, ConfigFactory} | ||
import scala.util.{Properties} | ||
|
||
object BackendConfig { | ||
|
||
val config: Config = ConfigFactory.load.getConfig("drwal.config") | ||
|
||
val environment = System.getProperty("TRAVIS") match { | ||
case null => "dev" | ||
case "" => "dev" | ||
case x: String => x | ||
} | ||
val url = "0.0.0.0" | ||
val port = Properties.envOrElse("PORT", "8080").toInt | ||
|
||
object MongoConfig { | ||
private val mongoConfig = config.getConfig("mongodb") | ||
//private val mongoConfig = config.getConfig("mongodb") | ||
|
||
var url = "" | ||
var database = "" | ||
val uri = Properties.envOrElse("MONGOLAB_URI", "localhost") | ||
val database = "heroku_app33528479" | ||
} | ||
|
||
if (environment == "dev") { | ||
url = mongoConfig.getString("url") | ||
database = mongoConfig.getString("database") | ||
} else { | ||
url = System.getProperty("MONGOLAB_URI") | ||
database = mongoConfig.getString("heroku_app33528479") | ||
} | ||
object TwitterConfig { | ||
val _consumerKey = "" | ||
val _consumerSecret = "" | ||
|
||
// TODO: travis config | ||
val consumerKey = Properties.envOrElse("CONSUMER_KEY", _consumerKey) | ||
val consumerSecret = Properties.envOrElse("CONSUMER_SECRET", _consumerSecret) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters