<commit_before>require 'api_constraints'

Rails.application.routes.draw do
  root to: 'application#welcome'
  apipie
  namespace :api, defaults: { format: :json } do
    scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do
      mount_devise_token_auth_for 'User', at: 'auth'
      resources :users,      only: [:index, :show, :create, :update, :destroy]
      resources :categories, only: [:index, :show, :create, :update, :destroy] do
        get 'products',      on: :member
        get 'subcategories', on: :member
        get 'count',         on: :collection
      end
      resources :products,   only: [:index, :show, :create, :update, :destroy]
      resources :images,     only: [:index, :show, :create, :update, :destroy]
      resources :orders,     only: [:index, :show, :create, :update, :destroy]
      resources :reviews,    only: [:index, :show, :create, :update, :destroy]<commit_msg>Add admin routes<commit_after>require 'api_constraints'

Rails.application.routes.draw do
  root to: 'application#welcome'
  apipie
  namespace :api, defaults: { format: :json } do
    scope module: :v1, constraints: ApiConstraints.new(version: 1, default: true) do
      mount_devise_token_auth_for 'User',  at: 'user'
      mount_devise_token_auth_for 'Admin', at: 'admin'

      resources :users,      only: [:index, :show, :create, :update, :destroy]
      resources :categories, only: [:index, :show, :create, :update, :destroy] do
        get 'products',      on: :member
        get 'subcategories', on: :member
        get 'count',         on: :collection
      end
      resources :products,   only: [:index, :show, :create, :update, :destroy]
      resources :images,     only: [:index, :show, :create, :update, :destroy]
      resources :orders,     only: [:index, :show, :create, :update, :destroy]
      resources :reviews,    only: [:index, :show, :create, :update, :destroy]
{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.0020855057351407717, 'mean_word_length': 3.4524361948955917, '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': '7509588', 'n_tokens_mistral': 604, 'n_tokens_neox': 604, 'n_words': 183}