Class: Graphql::Dashboard::StaticsController

Inherits:
ApplicationController show all
Defined in:
lib/graphql/dashboard/statics_controller.rb

Constant Summary collapse

STATICS =

Use an explicit list of files to avoid any chance of reading other files from disk

{}

Instance Method Summary collapse

Methods inherited from ApplicationController

#schema_class

Instance Method Details

#showObject



21
22
23
24
25
26
27
28
# File 'lib/graphql/dashboard/statics_controller.rb', line 21

def show
  expires_in 1.year, public: true
  if (filepath = STATICS[params[:id]])
    render file: filepath
  else
    head :not_found
  end
end