diff --git a/app/api/houdini/v1/api.rb b/app/api/houdini/v1/api.rb index 0940fac6..d0e3a921 100644 --- a/app/api/houdini/v1/api.rb +++ b/app/api/houdini/v1/api.rb @@ -14,9 +14,9 @@ class Houdini::V1::API < Grape::API mount Houdini::V1::Nonprofit => '/nonprofit' # Additional mounts are added via generators above this line # DON'T REMOVE THIS OR THE PREVIOUS LINES!!! - uriForHost = URI.parse(Settings.cdn.url) + uri_for_host = URI.parse(Settings.api_domain&.url || Settings.cdn.url) add_swagger_documentation \ - host: "#{uriForHost.host}#{Settings.cdn.port ? ":#{Settings.cdn.port}" : ""}", - schemes: [uriForHost.scheme], + host: "#{uri_for_host.host}#{uri_for_host.port ? ":#{uri_for_host.port}" : ""}", + schemes: [uri_for_host.scheme], base_path: '/api/v1' end \ No newline at end of file diff --git a/config/default_organization.yml b/config/default_organization.yml index e24b45a8..155cc596 100644 --- a/config/default_organization.yml +++ b/config/default_organization.yml @@ -27,3 +27,6 @@ intntl: symbol: "€" abbv: "eur" format: "%n%u" + +api_domain: + url: "http://localhost:5000" diff --git a/config/environment.rb b/config/environment.rb index 31707397..74e95206 100755 --- a/config/environment.rb +++ b/config/environment.rb @@ -284,6 +284,11 @@ Config.schema do required(:url).filled?(:str) end + # the domain for your api. Usually will be your CDN.url + optional(:api_domain).schema do + required(:url).filled?(:str) + end + end Settings.reload! diff --git a/config/settings.yml b/config/settings.yml index 560c403a..3d74efd0 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -73,3 +73,6 @@ source_tokens: nonprofits_must_be_vetted: false +api_domain: + url: "http://localhost:5000" +