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

【Cool Snippet】Template 从 Gist 上动态获取 #2

Open
leeduckgo opened this issue May 15, 2022 · 0 comments
Open

【Cool Snippet】Template 从 Gist 上动态获取 #2

leeduckgo opened this issue May 15, 2022 · 0 comments

Comments

@leeduckgo
Copy link
Contributor

Test Live Now:

defmodule CodesOnChain.TestLive do
  @moduledoc """
    Test to impl a dynamic webpage by snippet!
  """
  
  use FunctionServerBasedOnArweaveWeb, :live_view
  alias Components.KVHandler.KVRouter

  def get_module_doc, do: @moduledoc
  
  @impl true
  def render(assigns) do
    ~H"""
      Hello World!
    """
  end

  def register() do
    KVRouter.put_routes(
      [
        ["/uri1", Atom.to_string(__MODULE__), "index"]
      ]
    )
  end

  @impl true
  def mount(_params, _session, socket) do
    {:ok, socket}
  end

  @impl true
  def handle_event(_key, _params, socket) do
    {:noreply, socket}
  end

end

change the render() func, let the template from a html file from gist(Using the Component.Gist

@leeduckgo leeduckgo transferred this issue from NonceGeek/tai_shang_micro_faas_system May 16, 2022
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

1 participant