Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Create an example and demo on_router event #221

Open
3 tasks
shahryarjb opened this issue Nov 22, 2022 · 0 comments
Open
3 tasks

Create an example and demo on_router event #221

shahryarjb opened this issue Nov 22, 2022 · 0 comments
Assignees

Comments

@shahryarjb
Copy link
Owner

shahryarjb commented Nov 22, 2022

  • Should be rechecked in real-example, consider type of @type and defstruct
  • Do not use it until a stable version is released
  • why this type() was created?

elixir macros for router

  live(path, live_view, action \\ nil, opts \\ [])
  live "/", TrackappWeb.Live.DepGetter

  delete(path, plug, plug_opts, options \\ [])
  delete("/events/:id", EventController, :action)

  forward(path, plug, plug_opts \\ [], router_opts \\ [])
  forward "/admin", SomeLib.AdminDashboard

  get(path, plug, plug_opts, options \\ [])
  get("/events/:id", EventController, :action)

  post(path, plug, plug_opts, options \\ [])
  post("/events/:id", EventController, :action)

  put(path, plug, plug_opts, options \\ [])
  put("/events/:id", EventController, :action)

  scope "/" do
    pipe_through :browser
    Enum.map(["1", "2"], fn x ->
      live("/x", TrackappWeb.Live.DepGetter)
    end)
  end
@shahryarjb shahryarjb self-assigned this Nov 22, 2022
@shahryarjb shahryarjb transferred this issue from mishka-group/mishka_installer Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant