<commit_before>defmodule Cazoc.Router do
  use Cazoc.Web, :router
  use ExAdmin.Router
  require Ueberauth

  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

  # setup the ExAdmin routes
  scope "/admin", ExAdmin do
    pipe_through :browser
    admin_routes
  end

  scope "/", Cazoc do
    pipe_through :browser # Use the default browser stack

    get "/", TopController, :index

    get    "/login",  SessionController, :new
    post   "/login",  SessionController, :create
    delete "/logout", SessionController, :delete

    get  "/register", RegistrationController, :new
    post "/register", RegistrationController, :create
  end

  scope "/", Cazoc do
    pipe_through :browser # Use the default browser stack

    get  "/search", SearchController, :index

    get  "/github", GithubController, :index
    post "/github", GithubController, :import
    delete "/github", GithubController, :delete

    resources "/authors", AuthorController
    resources "/articles", MyArticleController
    resources "/collaborators", CollaboratorController
    resources "/comments", CommentController
    resources "/families", MyFamilyController
    resources "/repositories", RepositoryController
    resources "/services", ServiceController
  end

  scope "/auth", Cazoc do
    pipe_through :browser

    get "/:provider", AuthController, :request
    get "/:provider/callback", AuthController, :callback
    post "/:provider/callback", AuthController, :callback
    delete "/logout", AuthController, :delete
  end

  scope "/api", Cazoc do
    pipe_through :api

    scope "/v1", as: :v1 do
      resources "/authors", AuthorController, only: [:index, :show]
      resources "/repositories", RepositoryController, only: [:index, :show]
      resources "/articles", MyArticleController, only: [:index, :show]
      resources "/comments", CommentController, only: [:index, :show]
      resources "/families", MyFamilyController, only: [:index, :show]
      resources "/collaborators", CollaboratorController, only: [:index, :show]
    end
  end
end
<commit_msg>Fix router for api<commit_after>defmodule Cazoc.Router do
  use Cazoc.Web, :router
  use ExAdmin.Router
  require Ueberauth

  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"]
    plug :fetch_session
    plug :fetch_flash
  end

  # setup the ExAdmin routes
  scope "/admin", ExAdmin do
    pipe_through :browser
    admin_routes
  end

  scope "/", Cazoc do
    pipe_through :browser # Use the default browser stack

    get "/", TopController, :index

    get    "/login",  SessionController, :new
    post   "/login",  SessionController, :create
    delete "/logout", SessionController, :delete

    get  "/register", RegistrationController, :new
    post "/register", RegistrationController, :create

    get  "/github", GithubController, :index
    post "/github", GithubController, :import
    delete "/github", GithubController, :delete

    get  "/search", SearchController, :index
  end

  scope "/", Cazoc do
    pipe_through :browser # Use the default browser stack

    resources "/authors", AuthorController
    resources "/articles", MyArticleController
    resources "/collaborators", CollaboratorController
    resources "/comments", CommentController
    resources "/families", MyFamilyController
    resources "/repositories", RepositoryController
    resources "/services", ServiceController
  end

  scope "/auth", Cazoc do
    pipe_through :browser

    get "/:provider", AuthController, :request
    get "/:provider/callback", AuthController, :callback
    post "/:provider/callback", AuthController, :callback
    delete "/logout", AuthController, :delete
  end

  scope "/api", Cazoc do
    pipe_through :api

    scope "/v1", as: :v1 do
      resources "/authors", AuthorController, only: [:index, :show]
      resources "/repositories", RepositoryController, only: [:index, :show]
      resources "/articles", MyArticleController, only: [:index, :show]
      resources "/comments", CommentController, only: [:index, :show]
      resources "/families", MyFamilyController, only: [:index, :show]
      resources "/collaborators", CollaboratorController, only: [:index, :show]
    end
  end
end

{'fraction_non_alphanumeric': 0.1079407210794072, 'fraction_numerical': 0.0008847600088476001, 'mean_word_length': 3.6331967213114753, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6365598', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1233, 'n_words': 405}