# All files / nodejs-homework-API/routes/api user.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
    16
    17
    18
    19
    201x
    1x
    1x
    1x
    1x
    1x

    1x

    1x
     const express = require("express");
    const router = express.Router();
    const controllers = require("../../controllers/user");
    const validation = require("./validation/validationUser");
    const guard = require("../../helpers/guard");
    const upload = require("../../helpers/upload");

    router
      .post("/register", validation.registration, controllers.createNewUser)
      .post("/login", validation.logIn, controllers.logIn)
      .post("/logout", guard, controllers.logout)
      .patch("/users", guard, controllers.updateSubscription)
      .patch(
        "/avatars",
        [guard, upload.single("avatar"), validation.validateUploadAvatar],
        controllers.saveAvatarForStatic
      )
      .get("/users/current", guard, controllers.getCurrent);
    module.exports = router;