diff --git a/app/controllers/bio_eddie_assets_controller.rb b/app/controllers/bio_eddie_assets_controller.rb index bc44ba9f5..31b9c0e79 100644 --- a/app/controllers/bio_eddie_assets_controller.rb +++ b/app/controllers/bio_eddie_assets_controller.rb @@ -4,10 +4,10 @@ class BioEddieAssetsController < ApplicationController include BioEddieActions include ActiveStorage::SetCurrent - before_action :load_vars, except: %i(create bmt_request) + before_action :load_vars, except: %i(create bmt_request license) before_action :load_create_vars, only: :create - before_action :check_read_permission, except: %i(update create start_editing bmt_request) + before_action :check_read_permission, except: %i(update create start_editing bmt_request license) before_action :check_edit_permission, only: %i(update create start_editing) def create @@ -43,8 +43,17 @@ class BioEddieAssetsController < ApplicationController end end + def license + license_file_path = Rails.root.join('data/bioeddie/license.cxl') + if File.file?(license_file_path) + send_file(license_file_path) + else + render_404 + end + end + def bmt_request - return_404 unless ENV['BIOMOLECULE_TOOLKIT_BASE_URL'] + return render_404 unless ENV['BIOMOLECULE_TOOLKIT_BASE_URL'] uri = URI.parse(ENV['BIOMOLECULE_TOOLKIT_BASE_URL']) uri.path = request.original_fullpath.remove('/biomolecule_toolkit') diff --git a/config/routes.rb b/config/routes.rb index 315caeea6..026c2848f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -774,6 +774,9 @@ Rails.application.routes.draw do end resources :bio_eddie_assets, only: %i(create update) do + collection do + get :license + end member do post :start_editing end diff --git a/data/bioeddie/.keep b/data/bioeddie/.keep new file mode 100644 index 000000000..e69de29bb