Simple plug to just fallback to the index.html file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Karta.Web.ReactPlug do | |
import Plug.Conn | |
def init(options), do: options | |
def call(conn, _opts) do | |
conn | |
|> put_resp_header("content-type", "text/html; charset=utf-8") | |
|> Plug.Conn.send_file(200, Application.app_dir(:karta_web, "priv/static/index.html")) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment