Permalink
Browse files

remove some needless stuff

  • Loading branch information...
sasa1977 committed Feb 20, 2016
1 parent 036273a commit 964f52eddd01610f729e2bd988e203428291cf82
@@ -1,37 +1,3 @@
defmodule SimpleServer.Endpoint do
use Phoenix.Endpoint, otp_app: :simple_server
-
- socket "/socket", SimpleServer.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: :simple_server, 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
- 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: "_simple_server_key",
- signing_salt: "rg7udXF+"
-
- plug SimpleServer.Router
end
@@ -20,8 +20,6 @@ defmodule SimpleServer.ConnCase do
# Import conveniences for testing with connections
use Phoenix.ConnTest
- import SimpleServer.Router.Helpers
-
# The default endpoint for testing
@endpoint SimpleServer.Endpoint
end
@@ -1,37 +0,0 @@
-defmodule SimpleServer.UserSocket do
- use Phoenix.Socket
-
- ## Channels
- # channel "rooms:*", SimpleServer.RoomChannel
-
- ## Transports
- transport :websocket, Phoenix.Transports.WebSocket
- # transport :longpoll, Phoenix.Transports.LongPoll
-
- # Socket params are passed from the client and can
- # be used to verify and authenticate a user. After
- # verification, you can put default assigns into
- # the socket that will be set for all channels, ie
- #
- # {:ok, assign(socket, :user_id, verified_user_id)}
- #
- # To deny connection, return `:error`.
- #
- # See `Phoenix.Token` documentation for examples in
- # performing token verification on connect.
- def connect(_params, socket) do
- {:ok, socket}
- end
-
- # Socket id's are topics that allow you to identify all sockets for a given user:
- #
- # def id(socket), do: "users_socket:#{socket.assigns.user_id}"
- #
- # Would allow you to broadcast a "disconnect" event and terminate
- # all active sockets and channels for a given user:
- #
- # SimpleServer.Endpoint.broadcast("users_socket:#{user.id}", "disconnect", %{})
- #
- # Returning `nil` makes this socket anonymous.
- def id(_socket), do: nil
-end
@@ -1,11 +0,0 @@
-defmodule SimpleServer.Router do
- use SimpleServer.Web, :router
-
- pipeline :api do
- plug :accepts, ["json"]
- end
-
- scope "/api", SimpleServer do
- pipe_through :api
- end
-end
@@ -16,47 +16,18 @@ defmodule SimpleServer.Web do
below.
"""
- def model do
- quote do
- # Define common model functionality
- end
- end
-
- def controller do
- quote do
- use Phoenix.Controller
-
- import SimpleServer.Router.Helpers
- import SimpleServer.Gettext
- end
- end
-
def view do
quote do
use Phoenix.View, root: "web/templates"
# Import convenience functions from controllers
import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1]
- import SimpleServer.Router.Helpers
import SimpleServer.ErrorHelpers
import SimpleServer.Gettext
end
end
- def router do
- quote do
- use Phoenix.Router
- end
- end
-
- def channel do
- quote do
- use Phoenix.Channel
- import SimpleServer.Gettext
- end
- end
-
@doc """
When used, dispatch to the appropriate controller/view/etc.
"""

0 comments on commit 964f52e

Please sign in to comment.