forked from komarserjio/notejam
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
before this, the lib directory is not checked in because .gitignore in the root directory ignores it komarserjio#60
- Loading branch information
Showing
3 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
defmodule Notejam do | ||
use Application | ||
|
||
# See http://elixir-lang.org/docs/stable/elixir/Application.html | ||
# for more information on OTP Applications | ||
def start(_type, _args) do | ||
import Supervisor.Spec, warn: false | ||
|
||
children = [ | ||
# Start the endpoint when the application starts | ||
supervisor(Notejam.Endpoint, []), | ||
# Start the Ecto repository | ||
worker(Notejam.Repo, []), | ||
# Here you could define other workers and supervisors as children | ||
# worker(Notejam.Worker, [arg1, arg2, arg3]), | ||
] | ||
|
||
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html | ||
# for other strategies and supported options | ||
opts = [strategy: :one_for_one, name: Notejam.Supervisor] | ||
Supervisor.start_link(children, opts) | ||
end | ||
|
||
# Tell Phoenix to update the endpoint configuration | ||
# whenever the application is updated. | ||
def config_change(changed, _new, removed) do | ||
Notejam.Endpoint.config_change(changed, removed) | ||
:ok | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
defmodule Notejam.Endpoint do | ||
use Phoenix.Endpoint, otp_app: :notejam | ||
|
||
socket "/socket", Notejam.UserSocket | ||
|
||
# Serve at "/" the static files from "priv/static" directory. | ||
# | ||
# You should set gzip to true if you are running phoenix.digest | ||
# when deploying your static files in production. | ||
plug Plug.Static, | ||
at: "/", from: :notejam, gzip: false, | ||
only: ~w(css fonts images js favicon.ico robots.txt) | ||
|
||
# Code reloading can be explicitly enabled under the | ||
# :code_reloader configuration of your endpoint. | ||
if code_reloading? do | ||
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket | ||
plug Phoenix.LiveReloader | ||
plug Phoenix.CodeReloader | ||
end | ||
|
||
plug Plug.RequestId | ||
plug Plug.Logger | ||
|
||
plug Plug.Parsers, | ||
parsers: [:urlencoded, :multipart, :json], | ||
pass: ["*/*"], | ||
json_decoder: Poison | ||
|
||
plug Plug.MethodOverride | ||
plug Plug.Head | ||
|
||
plug Plug.Session, | ||
store: :cookie, | ||
key: "_notejam_key", | ||
signing_salt: "Nd5mMdx1" | ||
|
||
plug Notejam.Router | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
defmodule Notejam.Repo do | ||
use Ecto.Repo, otp_app: :notejam | ||
end |