Create index.js
Browse files
index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const SHORT_URL = "https://tinyurl.com/2cnj72yj";
|
| 2 |
+
|
| 3 |
+
// Check SSLONLY env variable (like your bash logic)
|
| 4 |
+
if (!process.env.SSLONLY) {
|
| 5 |
+
console.log("\n\nNavigate to this URL:\n");
|
| 6 |
+
console.log(SHORT_URL);
|
| 7 |
+
} else {
|
| 8 |
+
console.log("SSLONLY is set, skipping URL output.");
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
console.log("\nPress Ctrl-C to exit 🛑\n");
|
| 12 |
+
|
| 13 |
+
// Keep process alive
|
| 14 |
+
const interval = setInterval(() => {}, 1000);
|
| 15 |
+
|
| 16 |
+
// Handle Ctrl+C properly
|
| 17 |
+
process.on("SIGINT", () => {
|
| 18 |
+
console.log("\nStopping... 🛑");
|
| 19 |
+
clearInterval(interval);
|
| 20 |
+
process.exit(0);
|
| 21 |
+
});
|