Files
Alvand-P/templates/config/frontend/shahoo.env.js.erb
2026-08-13 19:42:08 +03:30

25 lines
1.0 KiB
Plaintext

window.env = window.env || {};
<% domain = @config['app']['domain'].to_s.strip %>
<% brand_slug = domain.split('.').first.to_s.downcase %>
<% brand_name = brand_slug.empty? ? @config['app']['name'].to_s : brand_slug.capitalize %>
<% exchange_slug = brand_slug.empty? ? brand_name.downcase : brand_slug %>
<% shahoo_host = @config['app']['shahoo_host'].to_s.strip %>
<% shahoo_host = "#{@config['app']['shahoo_subdomain'] || 'shahoo'}.#{domain}" if shahoo_host.empty? %>
window.env.app = {
domain: '<%= domain %>',
name: '<%= @config['app']['name'] %>',
brandName: '<%= brand_name %>',
exchangeSlug: '<%= exchange_slug %>',
};
window.env.api = {
rangerUrl: '<%= ssl_helper('ws') %>://<%= shahoo_host %>/api/v2/ranger',
};
window.env.rangerEnabled = true;
window.env.incrementalOrderBook = true;
window.env.captcha = {
captchaType: '<%= @config['captcha']['type'] %>',
siteKey: '<%= @config['captcha']['siteKey'] %>',
};
window.env.captchaLogin = <%= @config['captchaLogin'] %>;
window.env.showLanding = <%= !!@config.dig('app', 'show_landing') %>;