1
1
Fork 0
mirror of https://github.com/Akif9748/akf-forum.git synced 2025-01-11 17:13:20 +03:00
akf-forum/routes/.js

18 lines
No EOL
498 B
JavaScript

const { UserModel, ThreadModel, MessageModel } = require("../models")
const { Router } = require("express");
const app = Router();
app.get("/", async (req, res) => {
const
mem = process.memoryUsage().heapUsed / Math.pow(2, 20),
users = await UserModel.count({}),
threads = await ThreadModel.count({}),
messages = await MessageModel.count({}),
user = req.user;
res.render("index", { mem, user, users, threads, messages })
})
module.exports = app;