sleep-tracker-backend/services/dailyAverages/dailyAveragesRouter.js
ruihildt 77a4c28757 Fix dailyAverages query on session update & test
- Add dailyAverages seeds
- Start implementing testing
2019-08-02 01:18:56 +02:00

15 lines
338 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;