diff options
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities/internal.rb | 19 | ||||
-rw-r--r-- | lib/api/internal/pages.rb | 7 |
2 files changed, 25 insertions, 1 deletions
diff --git a/lib/api/entities/internal.rb b/lib/api/entities/internal.rb new file mode 100644 index 00000000000..8f79bd14833 --- /dev/null +++ b/lib/api/entities/internal.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module API + module Entities + module Internal + module Pages + class LookupPath < Grape::Entity + expose :project_id, :access_control, + :source, :https_only, :prefix + end + + class VirtualDomain < Grape::Entity + expose :certificate, :key + expose :lookup_paths, using: LookupPath + end + end + end + end +end diff --git a/lib/api/internal/pages.rb b/lib/api/internal/pages.rb index 6ea048bde03..eaa434cff51 100644 --- a/lib/api/internal/pages.rb +++ b/lib/api/internal/pages.rb @@ -18,7 +18,12 @@ module API namespace 'internal' do namespace 'pages' do get "/" do - status :ok + host = PagesDomain.find_by_domain(params[:host]) + not_found! unless host + + virtual_domain = host.pages_virtual_domain + + present virtual_domain, with: Entities::Internal::Pages::VirtualDomain end end end |