All files / nodejs-homework-API/routes/api contacts.js

100% Statements 8/8
100% Branches 0/0
100% Functions 0/0
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161x 1x 1x 1x 1x 1x       1x         1x  
const express = require("express");
const router = express.Router();
const guard = require("../../helpers/guard");
const controllers = require("../../controllers/contacts");
const validation = require("./validation/validationContact");
router
  .get("/", guard, controllers.listContacts)
  .post("/", guard, validation.createContact, controllers.addContact);
 
router
  .get("/:contactId", guard, controllers.getContactById)
  .delete("/:contactId", guard, controllers.removeContact)
  .put("/:contactId", guard, validation.update, controllers.updateContact);
 
module.exports = router;