config
This commit is contained in:
23
deploy.sh
Normal file
23
deploy.sh
Normal file
@@ -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
|
||||
18
public/assets/js/config.js
Normal file
18
public/assets/js/config.js
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user