app/controllers/api/v1/application_controller.rb module Api module V1 class ApplicationController < ApplicationController include DeviseTokenAuth::Concerns::SetUserByToken protect_from_forgery with: :null_session before_action :authenticate_api_v1_user! respond_to :json end end end app/controllers/api/v1/application_controller.rb module Users class ApplicationController < ApplicationController before_action :authenticate_user! end end app/controllers/application_controller.rb class ApplicationController < ActionController::Base end config/routes.rb Rails.application.routes.draw do devise_for :users, controllers: { sessions: 'user_sessions', registrations: 'user_registrations' } namespace :api do scope :v1 do mount_devise_token_auth_for 'User', at: 'auth' end end root "cluster#index" get "get_config" => "cluster#get_config" resources :users end app/controllers/cluster_controller.rb class ClusterController < ApplicationController def index respond_to do |format| format.html # index.html.erb end end def get_config render json: [config] end end