Packages

IntegrateDB is a database sharing system. It provides integration primitives and data ownership and migration controls. Use it to integrate applications directly through a Postgres database.

Current section

Files

Jump to
integratedb lib integrate_web router.ex
Raw

lib/integrate_web/router.ex

defmodule IntegrateWeb.Router do
use IntegrateWeb, :router
pipeline :api do
plug :accepts, ["json"]
plug IntegrateWeb.AuthPlug
end
pipeline :authenticated do
plug IntegrateWeb.AuthRequiredPlug
end
pipeline :authenticated_unless_creating_root_user do
plug IntegrateWeb.AuthRequiredUnlessNoUsersPlug
end
scope "/api", IntegrateWeb do
pipe_through :api
scope "/v1" do
scope "/auth" do
post "/login", AuthController, :login
post "/renew", AuthController, :renew
end
scope "/" do
pipe_through :authenticated
resources "/users", UserController, except: [:new, :create, :edit]
scope "/stakeholders" do
resources "/", StakeholderController, except: [:new, :edit]
get "/:id/:type", SpecificationController, :show
put "/:id/:type", SpecificationController, :update
end
end
scope "/" do
pipe_through :authenticated_unless_creating_root_user
post "/users", UserController, :create
end
end
end
end