I have written mojo lite based websocket applications but am having
problems with my first attempt at a full application:
https://github.com/john-/mojo_inotifier
Here is what happens::
morbo script/inotifier
Server available at
http://127.0.0.1:3000
[Sun May 15 10:57:08 2016] [debug] GET "/"
[Sun May 15 10:57:08 2016] [debug] Routing to controller
"Inotifier::Controller::Actions" and action "base"
[Sun May 15 10:57:08 2016] [debug] Rendering template "base.html.ep"
[Sun May 15 10:57:08 2016] [debug] Template "layouts/default.html.ep"
not found
[Sun May 15 10:57:08 2016] [debug] 200 OK (0.006929s, 144.321/s)
[Sun May 15 10:57:08 2016] [debug] GET "/wsinit"
[Sun May 15 10:57:08 2016] [debug] Routing to controller
"Inotifier::Controller::Actions" and action "wsinit"
[Sun May 15 10:57:08 2016] [error] Can't call method "app" on an
undefined value at lib/Inotifier/Controller/Actions.pm line 15, <DATA>
line 2231.
[Sun May 15 10:57:08 2016] [debug] Template
"exception.development.html.ep" not found
[Sun May 15 10:57:08 2016] [debug] Template "exception.html.ep" not found
[Sun May 15 10:57:08 2016] [debug] Rendering template
"mojo/development.html.ep"
[Sun May 15 10:57:08 2016] [debug] Rendering template "mojo/mojobar.html.ep"
[Sun May 15 10:57:08 2016] [debug] 500 Internal Server Error (0.035149s,
28.450/s)
in wsinit $self for this route is undef. This means to me I am doing
something wrong with my route definition:
$r->websocket('/wsinit')->to(controller => 'actions', action =>
'wsinit');
I tried alternate ways such as
"$r->websocket('/wsinit')->to('actions#wsinit');" with the same result.
What am I missing here?
Thanks,
John