Goal: have a personal blog, and try out another point in the 'modular app design with elixir' space. Designing OTP systems with elixir had some interesting ideas.
15 lines
344 B
Elixir
15 lines
344 B
Elixir
defmodule FirehoseWeb.SitemapController do
|
|
@moduledoc """
|
|
Example controller for serving the blog sitemap.
|
|
"""
|
|
use MyAppWeb, :controller
|
|
|
|
def index(conn, _params) do
|
|
xml = Blogex.SEO.sitemap(Blogex.blogs(), FirehoseWeb.Endpoint.url())
|
|
|
|
conn
|
|
|> put_resp_content_type("application/xml")
|
|
|> send_resp(200, xml)
|
|
end
|
|
end
|