2020-05-21 19:48:20 +02:00
|
|
|
class StaticController < ActionController::API
|
|
|
|
|
include ActionView::Layouts
|
|
|
|
|
include BasicAuth
|
|
|
|
|
|
|
|
|
|
def frontend_index_html
|
|
|
|
|
if params[:path].present?
|
|
|
|
|
send_file params[:path]
|
|
|
|
|
else
|
|
|
|
|
render file: 'protected_public/index.html'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def frontend_static
|
|
|
|
|
full_path = "protected_public/#{params[:path]}.#{params[:format]}"
|
|
|
|
|
send_file full_path
|
2020-09-04 09:26:12 +03:00
|
|
|
rescue ActionController::MissingFile
|
|
|
|
|
render file: 'protected_public/index.html'
|
2020-05-21 19:48:20 +02:00
|
|
|
end
|
|
|
|
|
end
|