2019-08-01 18:43:43 +00:00
|
|
|
require("dotenv").config();
|
|
|
|
const router = require('express').Router();
|
|
|
|
|
|
|
|
const Averages = require('./dailyAveragesModel');
|
|
|
|
|
|
|
|
router.get('/:id/averages', (req, res) => {
|
2019-08-01 19:12:20 +00:00
|
|
|
Averages.getDailyAverages(req.params.id)
|
|
|
|
.then(averages => {
|
|
|
|
res.status(200).json(averages);
|
|
|
|
})
|
|
|
|
.catch(err => res.send(err));
|
2019-08-01 18:43:43 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = router;
|