Sửa lỗi tạo docker

This commit is contained in:
2026-06-12 07:59:10 +07:00
parent d7556aa087
commit 377c4d41d8
13 changed files with 342 additions and 26 deletions
+14
View File
@@ -4,6 +4,20 @@ const User = require('../models/User');
const router = express.Router();
/**
* @route GET /api/auth/init-status
* @desc Check if the system has at least one admin
* @access Public
*/
router.get('/init-status', async (req, res) => {
try {
const userCount = await User.countDocuments();
res.json({ initialized: userCount > 0 });
} catch (error) {
res.status(500).json({ message: error.message });
}
});
/**
* @route POST /api/auth/register
* @desc Register a new user