Created
May 7, 2018 01:59
-
-
Save webdeb/cdc5ed46c658032e9f4eacb655ce89af to your computer and use it in GitHub Desktop.
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