aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-08-29 09:33:20 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-08-29 16:17:34 +0100
commit68111f484bf27f03ce023497fdc5868c2b724ffb (patch)
treef8ffd8de32b1fce7925ee9759d6c808e8bcf3aca /script
parent66bd45b66911860dd2d59e5a6e38586a1641a2d7 (diff)
Add debug toolbar middleware.
If debug is enabled, using the CATALYST_DEBUG/FIXMYSTREET_APP_DEBUG environment variables, add a debug toolbar to the output, including request/response details and a database query log. This uses Plack middleware, so works by switching our dev server to use Starman with plack directly, rather than via the script runner. We remove the GZip compression as this interferes, and take a local copy of the QueryLog::AdoptPlack trait as it needs a tweak to work. Make sure the CSP header is not output in debug mode, as that would prevent the toolbar JavaScript from running.
Diffstat (limited to 'script')
-rwxr-xr-xscript/server3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/server b/script/server
index 2ed265a28..b1d72269e 100755
--- a/script/server
+++ b/script/server
@@ -3,4 +3,5 @@
set -e
cd "$(dirname "$0")/.."
-script/fixmystreet_app_server.pl --fork --restart --debug $@
+export FIXMYSTREET_APP_DEBUG=${FIXMYSTREET_APP_DEBUG=1}
+bin/cron-wrapper local/bin/plackup -s Starman --listen :3000 --Reload perllib,conf/general.yml