Skip to content

Commit 2aa1937

Browse files
committed
Merge branch 'develop'
2 parents 60900f5 + 2525a09 commit 2aa1937

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,9 @@ CACHE_URL=redis://localhost:6379/0/cache
7575
ELASTICSEARCH_ADDRESS=localhost:9200
7676

7777
S3_HOST_ALIAS=dev.hiring-assets.cbcortex.com
78+
79+
#
80+
# Admin Interface Cortex API Consumption Configuration
81+
#
82+
CORTEX_API_BASE_URL=http://localhost:3000/
83+
CORTEX_API_VERSION=v1

app/controllers/application_controller.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ def configure_permitted_parameters
2020

2121
def add_gon
2222
gon.push({
23-
:current_user => current_user,
24-
:settings => {
25-
:cortex_base_url => "#{request.protocol}#{request.host_with_port}/api/v1",
26-
:paging => {
27-
defaultPerPage: 10
28-
}
29-
}
30-
})
23+
current_user: current_user.as_json,
24+
settings: {
25+
cortex_base_url: "#{Cortex.config.cortex.api.base_url}api/#{Cortex.config.cortex.api.version}",
26+
paging: {
27+
defaultPerPage: 10
28+
}
29+
}
30+
})
3131
end
3232
end

config/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
development: &defaults
2+
cortex:
3+
api:
4+
base_url: <%= ENV['CORTEX_API_BASE_URL'] %>
5+
version: <%= ENV['CORTEX_API_VERSION'] %>
26
extra:
37
google_analytics_id: <%= ENV['GOOGLE_ANALYTICS_ID'] %>
48
cors:

0 commit comments

Comments
 (0)