MCPcopy Create free account
hub / github.com/dhatGuy/PERN-Store / createUser

Function createUser

server/controllers/users.controller.js:10–25  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

8};
9
10const createUser = async (req, res) => {
11 const { username, password, email, fullname } = req.body;
12 const hashedPassword = hashPassword(password);
13
14 const user = await userService.createUser({
15 username,
16 hashedPassword,
17 email,
18 fullname,
19 });
20
21 res.status(201).json({
22 status: "success",
23 user,
24 });
25};
26
27const getUserById = async (req, res) => {
28 const { id } = req.params;

Callers

nothing calls this directly

Calls 1

hashPasswordFunction · 0.85

Tested by

no test coverage detected