Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/Dockerfile_PreBuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM gcr.io/distroless/java:11

# Copy OBP source code
# Copy build artifact (.war file) into jetty from 'maven' stage.
COPY /obp-http4s-runner/target/obp-http4s-runner.jar /app/obp-http4s-runner.jar
# Copy build artifact (JAR file) from maven build
COPY /obp-api/target/obp-api.jar /app/obp-api.jar
WORKDIR /app
CMD ["obp-http4s-runner.jar"]
CMD ["obp-api.jar"]
2 changes: 1 addition & 1 deletion .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
continue-on-error: true
run: |
mkdir -p ./push
cp obp-http4s-runner/target/obp-http4s-runner.jar ./push/
cp obp-api/target/obp-api.jar ./push/
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
- name: Save .jar artifact
run: |
mkdir -p ./pull
cp obp-http4s-runner/target/obp-http4s-runner.jar ./pull/
cp obp-api/target/obp-api.jar ./pull/
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
Expand Down
12 changes: 11 additions & 1 deletion obp-api/src/main/scala/bootstrap/http4s/Http4sServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import cats.effect._
import code.api.util.APIUtil
import code.api.util.http4s.Http4sApp
import com.comcast.ip4s._
import org.http4s.Uri
import org.http4s.ember.server._

object Http4sServer extends IOApp {
Expand All @@ -12,7 +13,16 @@ object Http4sServer extends IOApp {
// new bootstrap.http4s.Http4sBoot().boot
new bootstrap.liftweb.Boot().boot

val host = APIUtil.getPropsValue("hostname","127.0.0.1")
// Parse hostname - support both "127.0.0.1" and "http://127.0.0.1" formats
private def parseHostname(hostnameValue: String): String = {
val trimmed = hostnameValue.trim
// Try to parse as URI first
Uri.fromString(trimmed).toOption
.flatMap(_.host.map(_.renderString))
.getOrElse(trimmed) // If not a valid URI, use as-is
}

val host = parseHostname(code.api.Constant.HostName)
val port = APIUtil.getPropsAsIntValue("dev.port",8080)

// Use shared httpApp configuration (same as tests)
Expand Down