Skip to content

Commit

Permalink
Merge branch 'release/0.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Mar 4, 2024
2 parents 7004c08 + 19f1b86 commit f876a23
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/polar_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ defmodule PolarWeb.Endpoint do
websocket: [connect_info: [session: @session_options]],
longpoll: [connect_info: [session: @session_options]]

plug PolarWeb.Plugs.HealthCheck

# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phx.digest
Expand Down
18 changes: 18 additions & 0 deletions lib/polar_web/plugs/health_check.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
defmodule PolarWeb.Plugs.HealthCheck do
import Plug.Conn

def init(opts), do: opts

def call(%Plug.Conn{request_path: "/health"} = conn, _opts) do
conn
|> send_resp(
200,
Jason.encode!(%{
status: "Polar serving images."
})
)
|> halt()
end

def call(conn, _opts), do: conn
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Polar.MixProject do
def project do
[
app: :polar,
version: "0.1.1",
version: "0.1.2",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit f876a23

Please sign in to comment.