const Router require express const router Router const User require mo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
const { Router } = require('express')
const router = Router()
const User = require('../models/User')
// Get all users
router.get('/get', async (req, res) => {
User.find().then((users) => res.json({
users: JSON.stringify(users)
})).catch((err) => {
return res.status(500).json(err);
});
})
module.exports = router