-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add /ping to wake Heroku app see: https://github.com/dwyl/ping
- Loading branch information
Showing
5 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
defmodule AuthWeb.PingController do | ||
use AuthWeb, :controller | ||
|
||
# see: github.com/dwyl/ping | ||
def ping(conn, params) do | ||
Ping.render_pixel(conn, params) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
defmodule AuthWeb.PingControllerTest do | ||
use AuthWeb.ConnCase | ||
|
||
test "GET /ping (GIF) renders 1x1 pixel", %{conn: conn} do | ||
conn = get(conn, Routes.ping_path(conn, :ping)) | ||
assert conn.status == 200 | ||
assert conn.state == :sent | ||
assert conn.resp_body =~ <<71, 73, 70, 56, 57>> | ||
end | ||
end |