trackmyd-api/apiRoutes.js

19 lines
426 B
JavaScript

const express = require('express');
const deviceController = require('./controllers/deviceController');
const router = express.Router();
router
.route('/devices')
.get(deviceController.index)
.post(deviceController.add);
router
.route('/devices/:deviceId')
.get(deviceController.view)
.put(deviceController.update)
.patch(deviceController.update)
.delete(deviceController.remove);
module.exports = router;