Class: Belt::WelcomeController

Inherits:
BeltController::Base show all
Defined in:
lib/belt/controllers/welcome_controller.rb

Overview

Gem-embedded welcome controller that serves the default "it works!" page.

Resolved via the ActionRouter's Belt

namespace fallback when no app-defined

WelcomeController exists. Gets replaced once the user defines their own root route.

Constant Summary collapse

ASSETS_DIR =
File.expand_path('../assets', __dir__)

Instance Attribute Summary

Attributes inherited from BeltController::Base

#body, #event

Instance Method Summary collapse

Methods inherited from BeltController::Base

#action_name, #admin?, after_action, after_actions, all_after_actions, all_before_actions, all_rescue_handlers, all_skipped_before_actions, #authenticate!, before_action, before_actions, #current_user_id, #dispatch, #employee?, #initialize, #params, rescue_from, rescue_handlers, skip_before_action, skipped_before_actions, #user_groups

Methods included from Helpers::Response

#cors_headers, #error_response, #handle_error_and_respond, #html_response, #success_response

Constructor Details

This class inherits a constructor from BeltController::Base

Instance Method Details

#showObject



14
15
16
17
18
19
20
# File 'lib/belt/controllers/welcome_controller.rb', line 14

def show
  title = ENV.fetch('WELCOME_TITLE', 'Welcome to Belt')
  subtitle = ENV.fetch('WELCOME_SUBTITLE', 'API Gateway → Lambda → DynamoDB — all connected.')
  app_name = ENV.fetch('APP_NAME', 'my-app')

  html_response(render_welcome_page(title: title, subtitle: subtitle, app_name: app_name))
end