keyan / tonic-time

Demonstration of dynamic pages with Phoenix Channels
MIT License
12 stars 0 forks source link

no route for `/time/socket/websocket` #1

Open craigbeck opened 7 years ago

craigbeck commented 7 years ago

followed instructions for demo but app errors on page load:

$ mix phoenix.server
Compiling 13 files (.ex)
warning: variable state is unused
  lib/tonic_time/time_manager.ex:25

Generated tonic_time app
[info] Running TonicTime.Endpoint with Cowboy using http://localhost:4000
19 Jul 19:25:07 - info: compiled 6 files into 2 files, copied 3 in 2.6 sec
[info] GET /time/socket/websocket
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /time/socket/websocket (TonicTime.Router)
    (tonic_time) web/router.ex:1: TonicTime.Router.match_route/4
    (tonic_time) web/router.ex:1: TonicTime.Router.do_call/2
    (tonic_time) lib/tonic_time/endpoint.ex:1: TonicTime.Endpoint.phoenix_pipeline/1
    (tonic_time) lib/plug/debugger.ex:123: TonicTime.Endpoint."call (overridable 3)"/2
    (tonic_time) lib/tonic_time/endpoint.ex:1: TonicTime.Endpoint.call/2
    (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
    (cowboy) /Users/cbeck/projects/tonic-time/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

[info] GET /
[debug] Processing by TonicTime.PageController.index/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 200 in 4ms
craigbeck commented 7 years ago

FWIW i updated to latest Phoenix (as of today) as I wasn't sure what version this machine had

keyan commented 7 years ago

@craigbeck -- sorry for the delay on this, didn't see this issue earlier!

The reason you are seeing this error is because the demo application contains some changes to allow for hosting using NGINX. If you want to run it locally you can remove the last commit on master and it should work fine. I have created a branch for this purpose: https://github.com/keyan/tonic-time/tree/no_nginx_changes

$ git checkout no_nginx_changes
$ mix deps.get
$ brunch build
$ mix phoenix.server

Let me know if you run into any other issues! I will keep this ticket open in case others run into the same problem.