You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There a few things in the router I think can be tidied up
using resources instead of get, post etc. This keeps the routes RESTful and avoids duplication/confusion with things like how we have logout defined. This will also involve some renaming of actions.
scopes - there are a few separate scopes that I question the necessity of, eg. login and logout. If there are cases where we will be using different plugs for a scope (i.e. I can see this for the "/admin" scope) then that makes sense as a different scope
related to above, using plugs in the scopes as appropriate. The require_admin.ex plug can be used for the admin scope, for example.
There a few things in the router I think can be tidied up
resources
instead ofget
,post
etc. This keeps the routes RESTful and avoids duplication/confusion with things like how we havelogout
defined. This will also involve some renaming of actions.login
andlogout
. If there are cases where we will be using different plugs for a scope (i.e. I can see this for the "/admin" scope) then that makes sense as a different scoperequire_admin.ex
plug can be used for the admin scope, for example.Some useful links to refer to:
resources/4
scope/2
Scoped routes
The text was updated successfully, but these errors were encountered: