Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict backend to API-only mode #597

Open
lfilmeyer opened this issue Aug 12, 2024 · 1 comment
Open

Restrict backend to API-only mode #597

lfilmeyer opened this issue Aug 12, 2024 · 1 comment
Labels
Role: ETL/Backend Tech Debt Fixing this will save us time long-term

Comments

@lfilmeyer
Copy link
Contributor

See https://cfb-public.slack.com/archives/C03TE14E3RP/p1722385703058509

The backend app is intended to be API-only and just serve JSON, not HTML. For instance, when a 500 error occurs, we currently serve an HTML error response.

@lfilmeyer lfilmeyer added Role: ETL/Backend Tech Debt Fixing this will save us time long-term labels Aug 12, 2024
@lfilmeyer lfilmeyer added this to the Post-MVP Launch milestone Aug 12, 2024
@mzagaja
Copy link
Member

mzagaja commented Sep 4, 2024

Mike tried:

-class ApplicationController < ActionController::Base
+class ApplicationController < ActionController::API
   # before_action :authenticate_user!
   include Pundit::Authorization
   after_action :verify_authorized, except: :index
diff --git a/backend/config/application.rb b/backend/config/application.rb
index cc61c07..06461ea 100644
--- a/backend/config/application.rb
+++ b/backend/config/application.rb
@@ -39,6 +39,9 @@ module UrbanLeagueHeatPumpAccelerator
     # Configure Active Job to use sucker_punch backend
     config.active_job.queue_adapter = :sucker_punch
 
+    config.api_only = true
+    config.debug_exception_response_format = :api
+
     config.autoload_paths += %W[#{config.root}/lib]

and it caused some tests to break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Role: ETL/Backend Tech Debt Fixing this will save us time long-term
Projects
None yet
Development

No branches or pull requests

2 participants