Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sent messages viewer error #33

Open
mayulu opened this issue Sep 6, 2018 · 1 comment
Open

Sent messages viewer error #33

mayulu opened this issue Sep 6, 2018 · 1 comment

Comments

@mayulu
Copy link

mayulu commented Sep 6, 2018

In my my_app/lib/my_app_web/router.ex:

defmodule MyApp.Router do
  use MyApp.Web,  :router

  if Mix.env == :dev do
    forward("/sent_messages", Apus.SentMessagesViewerPlug)
  end
end

After iex -S mix, it tells:

** (UndefinedFunctionError) function Apus.SentMessagesViewerPlug.init/1 is undefined (module Apus.SentMessagesViewerPlug is not available)
    Apus.SentMessagesViewerPlug.init([])

And I checked the file, no init() and call() functions, which should be required by Plug module.

@swelham
Copy link
Member

swelham commented Sep 7, 2018

The sent messages plug uses the Plug.Router module which implements the init and call functions for us.

Can you please let me which version of apus and elixir you are running and are you seeing this error when attempting to visit the url?

Also to note from your router config it looks like you are using phoenix. If this is the case, when running your app through iex you will need to specify that you want to start the phoenix server as well. You can do this using this command iex -S mix phx.server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants