From 84be09eca3485540589c4aa176f7825569cb4a5e Mon Sep 17 00:00:00 2001 From: BTCforPlebs Date: Sat, 27 Sep 2025 07:30:32 -0400 Subject: [PATCH] config --- deploy.sh | 23 +++++++++++++++++++++++ public/assets/js/config.js | 18 ++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 deploy.sh create mode 100644 public/assets/js/config.js diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..8ce6066 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Production deployment script for BTCforPlebs status service + +# Install dependencies +npm install + +# Set production environment +export NODE_ENV=production + +# Install PM2 if not already installed +if ! command -v pm2 &> /dev/null; then + npm install -g pm2 +fi + +# Start or restart the service with PM2 +pm2 restart checklinks.js || pm2 start checklinks.js --name "btcforplebs-status" + +# Save PM2 config to run on system startup +pm2 save + +# Show running processes +pm2 list \ No newline at end of file diff --git a/public/assets/js/config.js b/public/assets/js/config.js new file mode 100644 index 0000000..8a14acb --- /dev/null +++ b/public/assets/js/config.js @@ -0,0 +1,18 @@ +// Configuration for the frontend +const config = { + // API base URL - use localhost in development, services subdomain in production + apiBaseUrl: window.location.hostname === 'localhost' + ? 'http://localhost:5252' + : 'https://services.btcforplebs.com', + + // Debug mode - enable logging in development + debug: window.location.hostname === 'localhost' +}; + +// Set up logging +if (config.debug) { + console.log('Running in development mode'); + console.log('API Base URL:', config.apiBaseUrl); +} else { + console.log = function() {}; // Disable console.log in production +} \ No newline at end of file