Skip to content

Commit c567946

Browse files
committed
Merge branch 'develop' of https://github.com/delphi-hub/delphi-webapi into feat/global-sbt
updated the feature branch to contain the most recent changes on the develop branch to prepare the pull request.
2 parents 447233b + 4cb2246 commit c567946

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

build.sbt

+16
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ scalaVersion := "2.12.4"
77
libraryDependencies += "org.parboiled" %% "parboiled" % "2.1.4"
88
libraryDependencies += "com.typesafe.akka" %% "akka-http" % "10.0.11"
99

10+
val elastic4sVersion = "6.2.8"
11+
libraryDependencies ++= Seq(
12+
"com.sksamuel.elastic4s" %% "elastic4s-core" % elastic4sVersion,
13+
14+
// for the http client
15+
"com.sksamuel.elastic4s" %% "elastic4s-http" % elastic4sVersion,
16+
17+
// if you want to use reactive streams
18+
"com.sksamuel.elastic4s" %% "elastic4s-http-streams" % elastic4sVersion,
19+
20+
// testing
21+
"com.sksamuel.elastic4s" %% "elastic4s-testkit" % elastic4sVersion % "test",
22+
"com.sksamuel.elastic4s" %% "elastic4s-embedded" % elastic4sVersion % "test"
23+
)
24+
25+
1026
lazy val webapi = (project in file(".")).
1127
enablePlugins(JavaAppPackaging).
1228
enablePlugins(DockerPlugin).
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)