const express = require('express'); const cors = require('cors'); const app = express(); const PORT = process.env.PORT || 3000; app.use(cors()); app.use(express.json()); // Fake submarine database with realistic-looking data const submarines = [ { id: "SUB-001", name: "HMS Astute", country: "United Kingdom", type: "Nuclear Attack Submarine", class: "Astute-class", status: "ACTIVE", lastKnownPosition: { latitude: 51.5074, longitude: -0.1278, depth: "CLASSIFIED", speed: "CLASSIFIED", heading: "CLASSIFIED" }, lastUpdate: new Date().toISOString(), mission: "CLASSIFIED" }, { id: "SUB-002", name: "USS Virginia", country: "United States", type: "Nuclear Attack Submarine", class: "Virginia-class", status: "ACTIVE", lastKnownPosition: { latitude: 38.9072, longitude: -77.0369, depth: "CLASSIFIED", speed: "CLASSIFIED", heading: "CLASSIFIED" }, lastUpdate: new Date().toISOString(), mission: "CLASSIFIED" }, { id: "SUB-003", name: "Le Triomphant", country: "France", type: "Ballistic Missile Submarine", class: "Triomphant-class", status: "ACTIVE", lastKnownPosition: { latitude: 48.8566, longitude: 2.3522, depth: "CLASSIFIED", speed: "CLASSIFIED", heading: "CLASSIFIED" }, lastUpdate: new Date().toISOString(), mission: "CLASSIFIED" }, { id: "SUB-004", name: "INS Arihant", country: "India", type: "Ballistic Missile Submarine", class: "Arihant-class", status: "ACTIVE", lastKnownPosition: { latitude: 28.6139, longitude: 77.2090, depth: "CLASSIFIED", speed: "CLASSIFIED", heading: "CLASSIFIED" }, lastUpdate: new Date().toISOString(), mission: "CLASSIFIED" }, { id: "SUB-005", name: "K-329 Belgorod", country: "Russia", type: "Special Mission Submarine", class: "Belgorod-class", status: "ACTIVE", lastKnownPosition: { latitude: 55.7558, longitude: 37.6173, depth: "CLASSIFIED", speed: "CLASSIFIED", heading: "CLASSIFIED" }, lastUpdate: new Date().toISOString(), mission: "CLASSIFIED" }, { id: "SUB-006", name: "Type 094 Jin", country: "China", type: "Ballistic Missile Submarine", class: "Type 094", status: "ACTIVE", lastKnownPosition: { latitude: 39.9042, longitude: 116.4074, depth: "CLASSIFIED", speed: "CLASSIFIED", heading: "CLASSIFIED" }, lastUpdate: new Date().toISOString(), mission: "CLASSIFIED" }, { id: "SUB-007", name: "HMCS Victoria", country: "Canada", type: "Diesel-Electric Submarine", class: "Victoria-class", status: "ACTIVE", lastKnownPosition: { latitude: 45.4215, longitude: -75.6972, depth: "CLASSIFIED", speed: "CLASSIFIED", heading: "CLASSIFIED" }, lastUpdate: new Date().toISOString(), mission: "CLASSIFIED" }, { id: "SUB-008", name: "U-31", country: "Germany", type: "Diesel-Electric Submarine", class: "Type 212", status: "ACTIVE", lastKnownPosition: { latitude: 52.5200, longitude: 13.4050, depth: "CLASSIFIED", speed: "CLASSIFIED", heading: "CLASSIFIED" }, lastUpdate: new Date().toISOString(), mission: "CLASSIFIED" } ]; // Landing page app.get('/', (req, res) => { res.send(`
Real-time Military Submarine Monitoring System
● LIVE FEED ACTIVE
${submarines.length}
CLASSIFIED
${new Set(submarines.map(s => s.country)).size}
${new Date().toISOString()}
GET /api/submarines - List all tracked submarinesGET /api/submarines/:id - Get specific submarine detailsGET /api/status - System statusGET /api/statistics - Global statisticsAPI Documentation: /api/docs
🔒 Encrypted Connection | Military Grade Security
System Version 2.4.1 | © 2026 Global Naval Defense Network
Returns list of all tracked submarines
Returns details for a specific submarine
Returns system operational status
Returns global tracking statistics
Returns currently visible submarines (surface)
Note: This will always return 0 results 🤷