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
config :your_app, YourAppWeb.Endpoint, | |
load_from_system_env: true, | |
url: [scheme: "https", host: "your_app.herokuapp.com", port: 443], | |
force_ssl: [rewrite_on: [:x_forwarded_proto]], | |
cache_static_manifest: "priv/static/cache_manifest.json", | |
secret_key_base: Map.fetch!(System.get_env(), "SECRET_KEY_BASE") |
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
heroku config:set GOOGLE_CLIENT_ID=your_google_id |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Code removed for readbility --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<link rel="stylesheet" href="<%= static_path(@conn, "/css/tilex.css") %>"> <!-- Change it here --> | |
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
exports.config = { | |
files: { | |
javascripts: { | |
joinTo: "js/tilex.js" // Change it here | |
}, | |
stylesheets: { | |
joinTo: 'css/tilex.css', // Change it here | |
order: { | |
after: ["web/static/css/tilex.css"] // Change it here | |
} |
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
erlang_version=20.1 | |
elixir_version=1.5.2 | |
runtime_path=/app |
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
phoenix_relative_path=apps/your_app |
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
defp authenticate(%{info: info, uid: uid}) do | |
email = Map.get(info, :email) | |
name = Developer.format_username(Map.get(info, :name)) | |
case String.match?(email, ~r/@your_domain.com$/) do # Change your_domain to your domain | |
true -> | |
attrs = %{ | |
email: email, | |
username: name, | |
google_id: uid |
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
# config/dev.exs | |
config :tilex, :default_twitter_handle, "your_twitter_handle" | |
# config/test.exs | |
config :tilex, Tilex.Repo, | |
adapter: Ecto.Adapters.Postgres, | |
username: "your_username", # depending on your Postgres setup, most likely your home directory name |
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 YourAppWeb.Endpoint do | |
# Code removed for readability | |
plug Plug.Static, | |
at: "/", from: :tilex, gzip: false, # Change this line from :your_app to :tilex as shown | |
only: ~w(css fonts images js favicon.ico robots.txt) | |
# Code removed for readability | |
end |
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
http://localhost:4004/auth/google/callback | |
https://til.yourdomain.com/auth/google/callback |