Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
const express = require('express');
const path = require('path');
const app = express();
__path = process.cwd()
__path = process.cwd();
const bodyParser = require("body-parser");
const PORT = process.env.PORT || 5000;

// The seal is broken on port 10000 (Optimized for Render free-tier stability)
const PORT = process.env.PORT || 10000;
const {
qrRoute,
pairRoute
} = require('./routes');

// Granting the server infinite stamina to endure heavy traffic spikes
require('events').EventEmitter.defaultMaxListeners = 2000;

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, 'public')));


// Intercepting core communication lines
app.use('/qr', qrRoute);
app.use('/code', pairRoute);

Expand All @@ -26,6 +30,7 @@ app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});

// Outward dimensional rifts (Redirect routes)
app.get('/pairing', (req, res) => {
res.redirect('https://github.com/Casper-Tech-ke/pairing');
});
Expand All @@ -34,21 +39,30 @@ app.get('/projects', (req, res) => {
res.redirect('https://xcasper.space');
});


// Vitality link monitoring
app.get('/health', (req, res) => {
res.json({
status: 200,
success: true,
service: 'Pairing',
realm: 'MLTN-MD CORE ENGINE',
condition: 'PERFECT_STANDBY',
timestamp: new Date().toISOString()
});
});

// Awakening the system
app.listen(PORT, '0.0.0.0', () => {
console.log(`
Deployment Successful!

Pairing Server Running on http://localhost:` + PORT)
})
🔮 [THE SEALS ARE BROKEN] 🔮
=============================================================
"Do you truly believe you can control this power...?"
=============================================================
⚡ SYSTEM: MLTN-MD Pairing Interface Awake
🌌 REALM: Listening cleanly on Port: ${PORT}
🩸 STATUS: The shadow matrix has initialized perfectly.
=============================================================
[Waiting for a user to link their soul to the device matrix...]
`);
});

module.exports = app
module.exports = app;