1
0
mirror of https://github.com/franjsco/trackmyd-api synced 2025-06-06 00:29:14 +02:00

add get devices routes/controller

This commit is contained in:
Francesco Esposito
2019-02-19 19:21:19 +01:00
parent 64aa61a027
commit f3842099e1
3 changed files with 29 additions and 3 deletions

View File

@ -0,0 +1,13 @@
const Device = require('../models/deviceModel');
function index(req, res) {
Device.get((err, devices) => {
if (err) {
res.status(500).send();
}
res.json(devices);
});
}
module.exports.index = index;