Packages

This library is a summary of the functions that are generally required for Matching Web service development.

Current section

Files

Jump to
servicex_matching lib servicex_matching_web router.ex
Raw

lib/servicex_matching_web/router.ex

defmodule ServicexMatchingWeb.Router do
use ServicexMatchingWeb, :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
# pipline for Servicex add start.
pipeline :guardian_auth do
plug Servicex.AuthenticatePipeline
end
pipeline :grant_check do
plug Servicex.Plug.GrantChecker, repo: ServicexMatching.Test.Repo
end
pipeline :debug do
plug Servicex.Plug.Debug
end
# pipline for Servicex add end.
# routing for Servicex add start.
scope "/api", ServicexWeb do
pipe_through :api
post "sign-in", AuthenticatorController, :sign_in
end
scope "/api", ServicexMatchingWeb do
pipe_through [:api]
post "/create-joiner", UserProfileController, :create_joiner
pipe_through [:debug]
end
scope "/api", ServicexMatchingWeb do
pipe_through [:api, :guardian_auth]
get "/show-me", UserProfileController, :show_me
get "/my-plojects", ProjectController, :list_my_plojects
post "/create-my-record", RecordController, :create_my_record
post "/update-my-record", RecordController, :update_my_record
post "/update-joiner", UserProfileController, :update_joiner
end
scope "/api", ServicexMatchingWeb do
pipe_through [:api]
resources "/user-profiles", UserProfileController, except: [:new, :edit]
resources "/organizations", OrganizationController, except: [:new, :edit]
resources "/projects", ProjectController, except: [:new, :edit]
resources "/records", RecordController, except: [:new, :edit]
resources "/tags", TagController, except: [:new, :edit]
resources "/applications", ApplicationController, except: [:new, :edit]
end
# Other scopes may use custom stacks.
# scope "/api", ServicexMatchingWeb do
# pipe_through :api
# end
end