2022-02-26 21:12:54 +03:00
|
|
|
const { User } = require("../../classes/index");
|
|
|
|
const { get } = require("quick.db")
|
|
|
|
module.exports = (req, res) => {
|
|
|
|
if (!req.session.loggedin) return res.redirect('/login');
|
|
|
|
|
|
|
|
const mem = process.memoryUsage().heapUsed / Math.pow(2, 20);
|
|
|
|
const users = get("users").length;
|
|
|
|
const threads = get("threads").length;
|
2022-03-13 16:06:25 +03:00
|
|
|
const messages = get("messages").length;
|
2022-02-26 21:12:54 +03:00
|
|
|
const user = new User().getId(req.session.userid)
|
2022-03-13 16:06:25 +03:00
|
|
|
res.render("index", { mem, user, users, threads, messages })
|
2022-02-26 21:12:54 +03:00
|
|
|
}
|