sleep-tracker-backend/services/dailyAverages/dailyAveragesRouter.js

19 lines
366 B
JavaScript
Raw Normal View History

require("dotenv").config();
const router = require('express').Router();
const Averages = require('./dailyAveragesModel');
router.get('/:id/averages', (req, res) => {
Averages.findUserBy(req.params.id)
.first()
.then(response => {
res.status(200).json(response);
})
.catch(error => {
res.status(500).json(error);
});
});
module.exports = router;