diff --git a/config.json b/config.json
new file mode 100644
index 0000000..a7bf442
--- /dev/null
+++ b/config.json
@@ -0,0 +1,3 @@
+{
+ "port": 8080
+}
\ No newline at end of file
diff --git a/ejs/footer.ejs b/ejs/footer.ejs
new file mode 100644
index 0000000..fdb0d99
--- /dev/null
+++ b/ejs/footer.ejs
@@ -0,0 +1,20 @@
+
\ No newline at end of file
diff --git a/ejs/home.ejs b/ejs/home.ejs
new file mode 100644
index 0000000..1573675
--- /dev/null
+++ b/ejs/home.ejs
@@ -0,0 +1,57 @@
+
+
+
+
+
+ XernoBomb
+
+
+
+
+
+
+<%- include('footer') %>
+
\ No newline at end of file
diff --git a/index.js b/index.js
index 4e22938..0467fc6 100644
--- a/index.js
+++ b/index.js
@@ -1,15 +1,44 @@
const express = require('express');
-const app = express();
+const path = require('path');
+const { WebSocketServer } = require('ws');
+const { createServer } = require('http');
+const fs = require('fs');
+
const config = require('./config.json');
+let clients = [];
+
+const app = express();
+const server = createServer(app);
+const wss = new WebSocketServer({ server });
+
+wss.on('connection', function connection(ws) {
+ clients.push(ws);
+ ws.on('close', () => {
+ clients.pop(ws);
+ });
+});
+
+// auto refresh on frontend update
+let lastUpdateTime = Date.now();
+fs.watch('./ejs/', () => {
+ const now = Date.now();
+ if (now - lastUpdateTime > 50) {
+ clients.forEach((ws) => {
+ ws.send('update');
+ });
+ }
+ lastUpdateTime = now;
+});
app.use(express.json());
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'ejs'));
+
app.get('/', (req, res) => {
res.render('home');
});
-app.listen(config.port, () => {
+server.listen(config.port, () => {
console.log(`Server started on port ${config.port}`);
});
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..cb254f3
--- /dev/null
+++ b/package.json
@@ -0,0 +1,8 @@
+{
+ "dependencies": {
+ "ejs": "^3.1.10",
+ "express": "^5.1.0",
+ "fs": "^0.0.1-security",
+ "ws": "^8.18.2"
+ }
+}