summary refs log tree commit diff
path: root/src/api/routes/statusRoute.js
blob: 5c3231b5bfca4ad0f923529c6ec56d0308064992 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { DbUser } from '#db/index.js';

export const statusRoute = {
    route: '/status',
    async onGet(req, res) {
        const status = {
            status: 'ok',
            timestamp: new Date().toISOString(),
            users: await User.countDocuments()
        };

        res.status(200).json(status);
    }
};