File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -20,4 +20,8 @@ def user_not_authorized
2020 flash [ :alert ] = 'You are not authorized to perform this action.'
2121 redirect_to ( request . referrer || root_path )
2222 end
23+
24+ def not_found
25+ render json : { error : 'Not found' } , status : 404
26+ end
2327end
Original file line number Diff line number Diff line change 44# the maximum value specified for Puma. Default is set to 5 threads for minimum
55# and maximum; this matches the default thread size of Active Record.
66#
7- threads_count = ENV . fetch ( "RAILS_MAX_THREADS" ) { 5 }
8- threads threads_count , threads_count
97
10- # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11- #
12- port ENV . fetch ( "PORT" ) { 3000 }
8+ max_threads_count = ENV . fetch ( "RAILS_MAX_THREADS" ) { 5 }
9+ min_threads_count = ENV . fetch ( "RAILS_MIN_THREADS" ) { max_threads_count }
10+ threads min_threads_count , max_threads_count
1311
14- # Specifies the `environment` that Puma will run in.
15- #
12+ workers ENV . fetch ( "WEB_CONCURRENCY" ) { 2 }
13+ preload_app!
14+
15+ port ENV . fetch ( "PORT" ) { 3000 }
1616environment ENV . fetch ( "RAILS_ENV" ) { "development" }
1717
18+
19+ on_worker_boot do
20+ ActiveRecord ::Base . establish_connection if defined? ( ActiveRecord )
21+ end
22+
23+ plugin :tmp_restart
24+
1825# Specifies the number of `workers` to boot in clustered mode.
1926# Workers are forked webserver processes. If using threads and workers together
2027# the concurrency of the application would be max `threads` * `workers`.
5360#
5461
5562# Allow puma to be restarted by `rails restart` command.
56- plugin :tmp_restart
63+ # plugin :tmp_restart
Original file line number Diff line number Diff line change 6565 resources :cases do
6666 resources :case_comments , only : %i[ new create ]
6767 end
68+
69+ match '*path' , to : 'application#not_found' , via : :all
6870end
You can’t perform that action at this time.
0 commit comments