about summary refs log tree commit diff
path: root/lib/rook_web/router.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rook_web/router.ex')
-rw-r--r--lib/rook_web/router.ex28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/rook_web/router.ex b/lib/rook_web/router.ex
new file mode 100644
index 0000000..298d722
--- /dev/null
+++ b/lib/rook_web/router.ex
@@ -0,0 +1,28 @@
+defmodule RookWeb.Router do
+  use RookWeb, :router
+
+  pipeline :browser do
+    plug :accepts, ["html"]
+    plug :fetch_session
+    plug :fetch_flash
+    plug :protect_from_forgery
+    plug :put_secure_browser_headers
+  end
+
+  pipeline :api do
+    plug :accepts, ["json"]
+  end
+
+  scope "/", RookWeb do
+    pipe_through :browser
+
+    get "/", HomeController, :index
+    get "/share", AppController, :share
+    get "/:token", AppController, :request
+  end
+
+  # Other scopes may use custom stacks.
+  # scope "/api", RookWeb do
+  #   pipe_through :api
+  # end
+end