<commit_before>defmodule CodeCorps.Router do
  use CodeCorps.Web, :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-api", "json"]
    plug Guardian.Plug.VerifyHeader
    plug Guardian.Plug.LoadResource
  end

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

    get "/", PageController, :index
  end

  scope "/", CodeCorps, host: "api." do
    pipe_through :api

    post "/login", AuthController, :create
    delete "/logout", AuthController, :delete

    resources "/categories", CategoryController, except: [:delete]

    resources "/organizations", OrganizationController, except: [:new, :edit] do
      resources "/memberships", OrganizationMembershipController, only: [:index]
    end

    resources "/organization-memberships", OrganizationMembershipController, only: [:index, :show, :create, :update, :delete]

    resources "/posts", PostController, only: [:create, :index, :show, :update]

    resources "/previews", PreviewController, only: [:create]

    resources "/projects", ProjectController, except: [:delete] do
      resources "/posts", PostController, only: [:index, :show]
    end

    resources "/roles", RoleController, only: [:create, :index, :show]

    resources "/skills", SkillController, only: [:create, :index, :show]

    get "/users/email_available", UserController, :email_available
    get "/users/username_available", UserController, :username_available
    resources "/users", UserController, except: [:new, :edit]

    resources "/user-skills", UserSkillController, except: [:update]
    resources "/role-skills", RoleSkillController, except: [:update]

    get "/:slug", SluggedRouteController, :show
    get "/:slug/projects", ProjectController, :index
    get "/:slug/:project_slug", ProjectController, :show
  end
end
<commit_msg>Switch to using "only" in router<commit_after>defmodule CodeCorps.Router do
  use CodeCorps.Web, :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-api", "json"]
    plug Guardian.Plug.VerifyHeader
    plug Guardian.Plug.LoadResource
  end

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

    get "/", PageController, :index
  end

  scope "/", CodeCorps, host: "api." do
    pipe_through :api

    post "/login", AuthController, :create
    delete "/logout", AuthController, :delete

    resources "/categories", CategoryController, only: [:index, :show, :create, :update]

    resources "/organizations", OrganizationController, only: [:index, :show, :create, :update] do
      resources "/memberships", OrganizationMembershipController, only: [:index]
    end

    resources "/organization-memberships", OrganizationMembershipController, only: [:index, :show, :create, :update, :delete]

    resources "/posts", PostController, only: [:create, :index, :show, :update]

    resources "/previews", PreviewController, only: [:create]

    resources "/projects", ProjectController, only: [:index, :show, :create, :update] do
      resources "/posts", PostController, only: [:index, :show]
    end

    resources "/roles", RoleController, only: [:create, :index, :show]

    resources "/skills", SkillController, only: [:create, :index, :show]

    get "/users/email_available", UserController, :email_available
    get "/users/username_available", UserController, :username_available
    resources "/users", UserController, only: [:index, :show, :create, :update]

    resources "/user-skills", UserSkillController, only: [:index, :show, :create, :delete]
    resources "/role-skills", RoleSkillController, only: [:index, :show, :create, :delete]

    get "/:slug", SluggedRouteController, :show
    get "/:slug/projects", ProjectController, :index
    get "/:slug/:project_slug", ProjectController, :show
  end
end

{'fraction_non_alphanumeric': 0.1313549014838239, 'fraction_numerical': 0.0, 'mean_word_length': 4.258312020460358, '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': '3570563', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1185, 'n_words': 355}