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
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.strigify(users) }))
.catch(err => {
logger.error("LEVEL", err);
});
})
module.exports = router