[add] initial commit

This commit is contained in:
2021-02-24 03:22:52 -05:00
commit c8c91b21d9
57 changed files with 2707 additions and 0 deletions

26
config/routes.rb Normal file
View File

@@ -0,0 +1,26 @@
# frozen_string_literal: true
Rails.application.routes.draw do
# TODO: add version namespace (API_VERSION_NAMESPACE - v1)
# allow for subdir deployment, disable format and allow :name to have all ascii symbols except /
scope RynDNS::Application::RELATIVE_URL_ROOT, format: false, constraints: { name: %r{[^/]+} } do
scope '/admin' do
post 'client', to: 'clients#create', format: false
put 'client', to: 'clients#update', format: false
resources :clients, only: %i[index show destroy], param: :name, format: false
end
scope '/client' do
# client (write)
put '', to: 'clients#update_ipv4', format: false
delete '', to: 'clients#destroy_ipv4', format: false
end
scope '/clients' do
# client (read)
get ':name', to: 'clients#show_ipv4', format: false
end
# separate public path to allow for easier segregation and controls via reverse proxy
scope '/public' do
get ':name', to: 'clients#show_public_ipv4', format: false
end
end
end