Skip to content

Commit 4cb2246

Browse files
committed
Added a configuration object
1 parent e3cd594 commit 4cb2246

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package de.upb.cs.swt.delphi.webapi
2+
3+
import com.sksamuel.elastic4s.ElasticsearchClientUri
4+
5+
/**
6+
* @author Ben Hermann
7+
*/
8+
class Configuration(val bindHost: String = "0.0.0.0",
9+
val bindPort: Int = 8080,
10+
val elasticsearchClientUri: ElasticsearchClientUri = ElasticsearchClientUri(
11+
sys.env.getOrElse("DELPHI_ELASTIC_URI", "elasticsearch://localhost:9200"))) {
12+
13+
}

src/main/scala/de/upb/cs/swt/delphi/webapi/Server.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ object Server extends HttpApp {
4545
}
4646

4747
def main(args: Array[String]): Unit = {
48-
Server.startServer("0.0.0.0", 8080)
48+
val configuration = new Configuration()
49+
Server.startServer(configuration.bindHost, configuration.bindPort)
4950
}
5051

5152

0 commit comments

Comments
 (0)