Module: NginxStage::AppConfigView

Included in:
AppConfigGenerator, AppResetGenerator
Defined in:
lib/nginx_stage/views/app_config_view.rb

Overview

A view used as context for the app config ERB template file

Instance Method Summary collapse

Instance Method Details

#app_passenger_envString

The Passenger environment to run app under

Returns:

  • (String)

    Passenger app environment



18
19
20
# File 'lib/nginx_stage/views/app_config_view.rb', line 18

def app_passenger_env
  NginxStage.app_passenger_env(env: env, owner: owner, name: name)
end

#app_request_uriString

The URI used to access the app from the browser

Returns:

  • (String)

    the app URI



6
7
8
# File 'lib/nginx_stage/views/app_config_view.rb', line 6

def app_request_uri
  "#{sub_uri}#{NginxStage.app_request_uri(env: env, owner: owner, name: name)}"
end

#app_rootString

Path to the app root on the local filesystem

Returns:

  • (String)

    path to app root



12
13
14
# File 'lib/nginx_stage/views/app_config_view.rb', line 12

def app_root
  NginxStage.app_root(env: env, owner: owner, name: name)
end

#app_tokenString

The token used to identify an app

Returns:

  • (String)

    unique app token



24
25
26
# File 'lib/nginx_stage/views/app_config_view.rb', line 24

def app_token
  NginxStage.app_token(env: env, owner: owner, name: name)
end

#sendfile_rootString

Path to the filesystem root where files are served from NB: Need to use a regular expression for user as this will be in a global app config that all users share

Returns:

  • (String)

    path to filesystem root



38
39
40
# File 'lib/nginx_stage/views/app_config_view.rb', line 38

def sendfile_root
  NginxStage.pun_sendfile_root(user: "[\w-]+")
end

#sendfile_uriString

Internal URI used to access filesystem from apps

Returns:

  • (String)

    the filesystem URI



30
31
32
# File 'lib/nginx_stage/views/app_config_view.rb', line 30

def sendfile_uri
  NginxStage.pun_sendfile_uri
end