Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
10 changes: 10 additions & 0 deletions server/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ end

config :orcasite, :prod_host, System.get_env("PROD_HOST_URL", "live.orcasound.net")

config :orcasite, :shipnoise_api_url,
System.get_env("SHIPNOISE_API_URL", "http://localhost:5000")

if config_env() == :prod do
database_url =
System.get_env("DATABASE_URL") ||
Expand Down Expand Up @@ -58,6 +61,13 @@ if config_env() == :prod do
config :orcasite, :feed_stream_queue_url, System.get_env("FEED_STREAM_QUEUE_URL")
end

# Shipnoise backend API URL (the separate shipnoise API service)
# Requests to /api/shipnoise/* are proxied to this URL
# Example: SHIPNOISE_API_URL=https://api.shipnoise.net
if System.get_env("SHIPNOISE_API_URL", "") != "" do
config :orcasite, :shipnoise_api_url, System.get_env("SHIPNOISE_API_URL")
end

config :orcasite, OrcasiteWeb.Endpoint,
url: [host: host, port: 443, scheme: "https"],
http: [
Expand Down
10 changes: 10 additions & 0 deletions server/lib/orcasite_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ defmodule OrcasiteWeb.Router do
plug AshGraphql.Plug
end

# Proxy shipnoise backend API (separate service) — before the catch-all NextJS forward
scope "/api/shipnoise" do
pipe_through(:api)

forward("/", ReverseProxyPlug,
upstream: fn -> Application.get_env(:orcasite, :shipnoise_api_url, "http://localhost:5000") end,
error_callback: &__MODULE__.log_reverse_proxy_error/1
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
end

scope "/api/json" do
pipe_through(:api)

Expand Down
4 changes: 3 additions & 1 deletion ui/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
NEXT_PUBLIC_GQL_ENDPOINT='http://localhost:${SERVER_PORT:-4000}/graphql'
NEXT_PUBLIC_SOCKET_ENDPOINT='ws://localhost:${SERVER_PORT:-4000}/socket'
NEXT_PUBLIC_S3_BUCKET='dev-streaming-orcasound-net'
NEXT_PUBLIC_S3_BUCKET='dev-streaming-orcasound-net'
NEXT_PUBLIC_SHIPNOISE_API_URL='/api/shipnoise'
SHIPNOISE_API_URL='http://localhost:5000'
Binary file added ui/public/shipnoise/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ui/public/shipnoise/Search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ui/public/shipnoise/VesselIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ui/public/shipnoise/Warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions ui/public/shipnoise/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions ui/public/shipnoise/playbutton.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ui/public/shipnoise/up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading