dwyl / sleep

šŸ›Œ MVP Sleep-tracking App with Step-by-Step Tutorial
23 stars 3 forks source link

CHORE: Apple Touch Icons šŸ“± #58

Open nelsonic opened 2 years ago

nelsonic commented 2 years ago

At present when we visit the app http://localhost:4000 in Desktop Safari we see the following error:

[info] GET /
[debug] Processing with AppWeb.PageController.index/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 200 in 89ms
[info] GET /apple-touch-icon-precomposed.png
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /apple-touch-icon-precomposed.png (AppWeb.Router)
    (app 0.1.0) lib/phoenix/router.ex:406: AppWeb.Router.call/2
    (app 0.1.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.plug_builder_call/2
    (app 0.1.0) lib/plug/debugger.ex:136: AppWeb.Endpoint."call (overridable 3)"/2
    (app 0.1.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.call/2
    (phoenix 1.6.6) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4
    (cowboy 2.9.0) /deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
    (cowboy 2.9.0) /deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
    (cowboy 2.9.0) /deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
    (stdlib 3.15.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

[info] GET /apple-touch-icon.png
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /apple-touch-icon.png (AppWeb.Router)
    (app 0.1.0) lib/phoenix/router.ex:406: AppWeb.Router.call/2
    (app 0.1.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.plug_builder_call/2
    (app 0.1.0) lib/plug/debugger.ex:136: AppWeb.Endpoint."call (overridable 3)"/2
    (app 0.1.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.call/2
    (phoenix 1.6.6) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4
    (cowboy 2.9.0) /deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
    (cowboy 2.9.0) /deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
    (cowboy 2.9.0) /deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
    (stdlib 3.15.2) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

No doubt there will be a similar error when visiting the Heroku version on Mobile Safari ... šŸ“± Ideally we want decent touch icons so that: a. The Favicon appears when using the app on Desktop (rare) b. The Touch ("App") Icon appears when we create a Shortcut to the Web App (Heroku) on iOS. c. No annoying errors in the logs which are horrible UX for people running the app on their localhost

Todo

nelsonic commented 2 years ago

Borrow from: https://github.com/dwyl/app-mvp/blob/main/lib/app_web/templates/layout/icons.html.heex