← back to Billy Website
remove server.js.backup source leak from served root; add backup patterns to .gitignore
914c7b0cd5d5c7ff778b9488829a999a2d853455 · 2026-05-30 23:48:36 -0700 · SteveStudio2
server.js.backup was tracked in git and sat in the project root, which this
server serves directly — making it fetchable at /server.js.backup. Deleted
the file, untracked it from git, and added *.bak / *.backup / *.orig / etc.
patterns to .gitignore to prevent recurrence.
Files touched
M .gitignoreD server.js.backup
Diff
commit 914c7b0cd5d5c7ff778b9488829a999a2d853455
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date: Sat May 30 23:48:36 2026 -0700
remove server.js.backup source leak from served root; add backup patterns to .gitignore
server.js.backup was tracked in git and sat in the project root, which this
server serves directly — making it fetchable at /server.js.backup. Deleted
the file, untracked it from git, and added *.bak / *.backup / *.orig / etc.
patterns to .gitignore to prevent recurrence.
---
.gitignore | 9 ++++++
server.js.backup | 98 --------------------------------------------------------
2 files changed, 9 insertions(+), 98 deletions(-)
diff --git a/.gitignore b/.gitignore
index 1d7a585..0c3327a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,4 +11,13 @@ coverage/
.DS_Store
*.log
tmp/
+*.bak
+*.bak-*
+*.backup
+*.pre-*
+*.orig
+*.save
+*.old
+*~
+copy-of-*
diff --git a/server.js.backup b/server.js.backup
deleted file mode 100644
index fa28fa6..0000000
--- a/server.js.backup
+++ /dev/null
@@ -1,98 +0,0 @@
-const http = require('http');
-const fs = require('fs');
-const path = require('path');
-
-const PORT = 5300;
-
-// MIME types for different file extensions
-const mimeTypes = {
- '.html': 'text/html',
- '.css': 'text/css',
- '.js': 'text/javascript',
- '.json': 'application/json',
- '.png': 'image/png',
- '.jpg': 'image/jpeg',
- '.jpeg': 'image/jpeg',
- '.gif': 'image/gif',
- '.svg': 'image/svg+xml',
- '.ico': 'image/x-icon',
- '.woff': 'font/woff',
- '.woff2': 'font/woff2',
- '.ttf': 'font/ttf',
- '.eot': 'application/vnd.ms-fontobject'
-};
-
-const server = http.createServer((req, res) => {
- console.log(`${new Date().toISOString()} - ${req.method} ${req.url}`);
-
- // Default to index.html for root path
- let filePath = req.url === '/' ? '/index.html' : req.url;
-
- // Remove query string if present
- filePath = filePath.split('?')[0];
-
- // Construct full file path
- filePath = path.join(__dirname, filePath);
-
- // Get file extension
- const extname = String(path.extname(filePath)).toLowerCase();
- const contentType = mimeTypes[extname] || 'application/octet-stream';
-
- // Read and serve the file
- fs.readFile(filePath, (error, content) => {
- if (error) {
- if (error.code === 'ENOENT') {
- // File not found
- res.writeHead(404, { 'Content-Type': 'text/html' });
- res.end('<h1>404 - File Not Found</h1>', 'utf-8');
- } else {
- // Server error
- res.writeHead(500);
- res.end(`Server Error: ${error.code}`, 'utf-8');
- }
- } else {
- // Success
- res.writeHead(200, { 'Content-Type': contentType });
- res.end(content, 'utf-8');
- }
- });
-});
-
-server.listen(PORT, '0.0.0.0', () => {
- console.log('='.repeat(60));
- console.log('🎸 2755 Carmar Drive - Laurel Canyon Luxury Rental');
- console.log('='.repeat(60));
- console.log(`🚀 Server running at http://0.0.0.0:${PORT}/`);
- console.log(`📅 Started: ${new Date().toLocaleString()}`);
- console.log('='.repeat(60));
- console.log('\nPress Ctrl+C to stop the server\n');
-});
-
-// Handle server errors
-server.on('error', (error) => {
- if (error.code === 'EADDRINUSE') {
- console.error(`\n❌ Error: Port ${PORT} is already in use.`);
- console.error(`Please close the other application or choose a different port.\n`);
- process.exit(1);
- } else {
- console.error(`\n❌ Server Error: ${error.message}\n`);
- process.exit(1);
- }
-});
-
-// Graceful shutdown
-process.on('SIGTERM', () => {
- console.log('\n\n👋 Shutting down gracefully...');
- server.close(() => {
- console.log('✅ Server closed successfully\n');
- process.exit(0);
- });
-});
-
-process.on('SIGINT', () => {
- console.log('\n\n👋 Shutting down gracefully...');
- server.close(() => {
- console.log('✅ Server closed successfully\n');
- process.exit(0);
- });
-});
← 3026559 Fix port mismatch (5300 to 9100) and stale labels in shell s
·
back to Billy Website
·
(newest)