diff --git a/config/config.exs b/config/config.exs index 1f53aa4..452d61e 100644 --- a/config/config.exs +++ b/config/config.exs @@ -6,11 +6,11 @@ use Mix.Config # General application configuration -config :chess_phoenix, +config :chess, ecto_repos: [Chess.Repo] # Configures the endpoint -config :chess_phoenix, Chess.Endpoint, +config :chess, Chess.Endpoint, url: [host: "localhost"], secret_key_base: "iiTDTKorCWTFoeBgAkr35XZp22cNIM2RsmnHiHdzKAuSHXUGXx42z7lawAwiu1B1", render_errors: [view: Chess.ErrorView, accepts: ~w(html json)], diff --git a/config/dev.exs b/config/dev.exs index 2b34c64..f37a046 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -6,7 +6,7 @@ use Mix.Config # The watchers configuration can be used to run external # watchers to your application. For example, we use it # with brunch.io to recompile .js and .css sources. -config :chess_phoenix, Chess.Endpoint, +config :chess, Chess.Endpoint, http: [port: 4000], debug_errors: true, code_reloader: true, @@ -16,7 +16,7 @@ config :chess_phoenix, Chess.Endpoint, # Watch static and templates for browser reloading. -config :chess_phoenix, Chess.Endpoint, +config :chess, Chess.Endpoint, live_reload: [ patterns: [ ~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$}, @@ -34,8 +34,8 @@ config :logger, :console, format: "[$level] $message\n" config :phoenix, :stacktrace_depth, 20 # Configure your database -config :chess_phoenix, Chess.Repo, +config :chess, Chess.Repo, adapter: Ecto.Adapters.Postgres, - database: "chess_phoenix_dev", + database: "chess_dev", hostname: "localhost", pool_size: 10 diff --git a/config/prod.exs b/config/prod.exs index e6d5732..f616252 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -11,7 +11,7 @@ use Mix.Config # containing the digested version of static files. This # manifest is generated by the mix phoenix.digest task # which you typically run after static files are built. -config :chess_phoenix, Chess.Endpoint, +config :chess, Chess.Endpoint, http: [port: {:system, "PORT"}], url: [host: "example.com", port: 80], cache_static_manifest: "priv/static/manifest.json" @@ -24,7 +24,7 @@ config :logger, level: :info # To get SSL working, you will need to add the `https` key # to the previous section and set your `:url` port to 443: # -# config :chess_phoenix, Chess.Endpoint, +# config :chess, Chess.Endpoint, # ... # url: [host: "example.com", port: 443], # https: [port: 443, @@ -38,7 +38,7 @@ config :logger, level: :info # We also recommend setting `force_ssl`, ensuring no data is # ever sent via http, always redirecting to https: # -# config :chess_phoenix, Chess.Endpoint, +# config :chess, Chess.Endpoint, # force_ssl: [hsts: true] # # Check `Plug.SSL` for all available options in `force_ssl`. @@ -53,12 +53,12 @@ config :logger, level: :info # Alternatively, you can configure exactly which server to # start per endpoint: # -# config :chess_phoenix, Chess.Endpoint, server: true +# config :chess, Chess.Endpoint, server: true # # You will also need to set the application root to `.` in order # for the new static assets to be served after a hot upgrade: # -# config :chess_phoenix, Chess.Endpoint, root: "." +# config :chess, Chess.Endpoint, root: "." # Finally import the config/prod.secret.exs # which should be versioned separately. diff --git a/config/test.exs b/config/test.exs index b71e353..583056e 100644 --- a/config/test.exs +++ b/config/test.exs @@ -2,7 +2,7 @@ use Mix.Config # We don't run a server during test. If one is required, # you can enable the server option below. -config :chess_phoenix, Chess.Endpoint, +config :chess, Chess.Endpoint, http: [port: 4001], server: false @@ -10,10 +10,10 @@ config :chess_phoenix, Chess.Endpoint, config :logger, level: :warn # Configure your database -config :chess_phoenix, Chess.Repo, +config :chess, Chess.Repo, adapter: Ecto.Adapters.Postgres, username: "postgres", password: "postgres", - database: "chess_phoenix_test", + database: "chess_test", hostname: "localhost", pool: Ecto.Adapters.SQL.Sandbox diff --git a/lib/chess_phoenix.ex b/lib/chess.ex similarity index 100% rename from lib/chess_phoenix.ex rename to lib/chess.ex diff --git a/lib/chess_phoenix/endpoint.ex b/lib/chess/endpoint.ex similarity index 89% rename from lib/chess_phoenix/endpoint.ex rename to lib/chess/endpoint.ex index 4524d47..dec4dc8 100644 --- a/lib/chess_phoenix/endpoint.ex +++ b/lib/chess/endpoint.ex @@ -1,5 +1,5 @@ defmodule Chess.Endpoint do - use Phoenix.Endpoint, otp_app: :chess_phoenix + use Phoenix.Endpoint, otp_app: :chess socket "/socket", Chess.UserSocket @@ -8,7 +8,7 @@ defmodule Chess.Endpoint do # You should set gzip to true if you are running phoenix.digest # when deploying your static files in production. plug Plug.Static, - at: "/", from: :chess_phoenix, gzip: false, + at: "/", from: :chess, gzip: false, only: ~w(css fonts images js favicon.ico robots.txt) # Code reloading can be explicitly enabled under the @@ -35,7 +35,7 @@ defmodule Chess.Endpoint do # Set :encryption_salt if you would also like to encrypt it. plug Plug.Session, store: :cookie, - key: "_chess_phoenix_key", + key: "_chess_key", signing_salt: "9LqUhZTU" plug Chess.Router diff --git a/lib/chess/repo.ex b/lib/chess/repo.ex new file mode 100644 index 0000000..b4561db --- /dev/null +++ b/lib/chess/repo.ex @@ -0,0 +1,3 @@ +defmodule Chess.Repo do + use Ecto.Repo, otp_app: :chess +end diff --git a/lib/chess_phoenix/repo.ex b/lib/chess_phoenix/repo.ex deleted file mode 100644 index 5d3b4a6..0000000 --- a/lib/chess_phoenix/repo.ex +++ /dev/null @@ -1,3 +0,0 @@ -defmodule Chess.Repo do - use Ecto.Repo, otp_app: :chess_phoenix -end diff --git a/mix.exs b/mix.exs index fda7830..e34c8eb 100644 --- a/mix.exs +++ b/mix.exs @@ -2,7 +2,7 @@ defmodule Chess.Mixfile do use Mix.Project def project do - [app: :chess_phoenix, + [app: :chess, version: "0.0.1", elixir: "~> 1.2", elixirc_paths: elixirc_paths(Mix.env), diff --git a/web/gettext.ex b/web/gettext.ex index f77877e..58c6561 100644 --- a/web/gettext.ex +++ b/web/gettext.ex @@ -20,5 +20,5 @@ defmodule Chess.Gettext do See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. """ - use Gettext, otp_app: :chess_phoenix + use Gettext, otp_app: :chess end diff --git a/web/router.ex b/web/router.ex index 6765403..95ce8a5 100644 --- a/web/router.ex +++ b/web/router.ex @@ -17,6 +17,7 @@ defmodule Chess.Router do pipe_through :browser # Use the default browser stack get "/", PageController, :index + resources "/games", GameController end # Other scopes may use custom stacks.