Add clear page
This commit is contained in:
parent
5fdbde912b
commit
0197ccef76
9
index.js
9
index.js
@ -2,6 +2,8 @@ const fs = require("fs");
|
||||
const https = require("https");
|
||||
const express = require("express");
|
||||
const socketio = require("socket.io");
|
||||
const basicAuth = require("express-basic-auth");
|
||||
|
||||
const app = express();
|
||||
|
||||
const https_options = {
|
||||
@ -91,6 +93,13 @@ io.on("connection", (client) => {
|
||||
|
||||
app.use(express.static("src"));
|
||||
|
||||
app.get("/clear", basicAuth({users:{"quentin": "BlanquerCaca89"}, challenge: true}), (req, res) => {
|
||||
messagesHistory = [];
|
||||
res.send("message history was cleared");
|
||||
log("Admin cleared messages history");
|
||||
io.sockets.emit("refresh");
|
||||
});
|
||||
|
||||
app.listen(80, () => {
|
||||
log("Web server started on port 80")
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user