akf-forum/routes/.js

21 lines
510 B
JavaScript
Raw Normal View History

2022-03-21 23:53:22 +03:00
const { User } = require("../classes");
2022-03-13 16:16:46 +03:00
const { get } = require("quick.db")
2022-03-21 23:53:22 +03:00
const { Router } = require("express");
const app = Router();
app.get("/", (req, res) => {
2022-04-03 21:01:55 +03:00
const
mem = process.memoryUsage().heapUsed / Math.pow(2, 20),
users = get("users").length,
threads = get("threads").length,
messages = get("messages").length,
user = new User().getId(req.session.userid);
2022-03-21 23:53:22 +03:00
2022-03-13 16:16:46 +03:00
res.render("index", { mem, user, users, threads, messages })
2022-03-21 23:53:22 +03:00
})
module.exports = app;