15 lines
340 B
JavaScript
15 lines
340 B
JavaScript
require("dotenv").config();
|
|
const router = require('express').Router();
|
|
|
|
const Averages = require('./dailyAveragesModel');
|
|
|
|
router.get('/:id/averages', (req, res) => {
|
|
Averages.getDailyAverages(req.params.id)
|
|
.then(averages => {
|
|
res.status(200).json(averages);
|
|
})
|
|
.catch(err => res.send(err));
|
|
});
|
|
|
|
module.exports = router;
|