Skip to content

Commit e23bfc8

Browse files
Added User Count
1 parent 1db3022 commit e23bfc8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/routes/User/countUsers.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = (req, res) => {
2+
User.findAll(
3+
{},
4+
)
5+
.then((data) => {
6+
7+
return res.json({ count: data.length });
8+
9+
})
10+
.catch((error) => {
11+
console.log(error);
12+
return res.status(500).send("Internal Server Error.");
13+
});
14+
};
15+

0 commit comments

Comments
 (0)