mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-12-22 23:59:08 +03:00
26 lines
No EOL
576 B
JavaScript
26 lines
No EOL
576 B
JavaScript
const { User } = require("../classes");
|
|
const { get } = require("quick.db")
|
|
|
|
const { Router } = require("express");
|
|
const app = Router();
|
|
|
|
app.get("/", (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;
|
|
|
|
const messages = get("messages").length;
|
|
|
|
const user = new User().getId(req.session.userid)
|
|
|
|
res.render("index", { mem, user, users, threads, messages })
|
|
|
|
})
|
|
|
|
|
|
module.exports = app; |