Individual tweets are now viewable in their own pages

This commit is contained in:
2026-04-01 12:44:03 -04:00
parent 0ac0b68029
commit 0f41e86cf0
5 changed files with 374 additions and 22 deletions

View File

@@ -6,6 +6,14 @@ defmodule MixerWeb.PageController do
end
def index(conn, _params) do
render_spa(conn, nil)
end
def show(conn, %{"tweet_id" => tweet_id}) do
render_spa(conn, tweet_id)
end
defp render_spa(conn, tweet_id) do
asset_host = Application.get_env(:waffle, :asset_host, "http://localhost:3900")
bucket = Application.get_env(:waffle, :bucket, "mixer-bucket")
@@ -13,7 +21,8 @@ defmodule MixerWeb.PageController do
|> put_root_layout(html: {MixerWeb.Layouts, :spa_root})
|> render(:index,
current_user: conn.assigns[:current_user],
media_host: "#{asset_host}/#{bucket}"
media_host: "#{asset_host}/#{bucket}",
tweet_id: tweet_id
)
end
end