handle requests for frontend files through secured route
This commit is contained in:
17
app/controllers/static_controller.rb
Normal file
17
app/controllers/static_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user