Class: Graphql::Dashboard::StaticsController

Inherits:
ApplicationController show all
Defined in:
lib/graphql/dashboard.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



125
126
127
128
129
130
131
132
# File 'lib/graphql/dashboard.rb', line 125

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