From 815f11d5bce21af285211b883f4b14e502fdcc4c Mon Sep 17 00:00:00 2001 From: Primakov Alexandr Alexandrovich Date: Mon, 10 Feb 2025 22:07:54 +0300 Subject: [PATCH] add nav router --- server/routers/todo/index.js | 2 ++ server/routers/todo/nav/index.js | 51 ++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 server/routers/todo/nav/index.js diff --git a/server/routers/todo/index.js b/server/routers/todo/index.js index b7ca0dc..fb1b02e 100644 --- a/server/routers/todo/index.js +++ b/server/routers/todo/index.js @@ -5,9 +5,11 @@ const router = Router() const todoRouter = require('./routes') const authRouter = require('./auth') const commentRouter = require('./comment') +const navRouter = require('./nav') router.use('/auth', authRouter) router.use('/comment', commentRouter) +router.use('/nav', navRouter) router.use(todoRouter) diff --git a/server/routers/todo/nav/index.js b/server/routers/todo/nav/index.js new file mode 100644 index 0000000..bf776f8 --- /dev/null +++ b/server/routers/todo/nav/index.js @@ -0,0 +1,51 @@ +const router = require("express").Router(); + +router.get("/users", (req, res) => { + res.send({ + success: false, + body: [ + { + id: "some-user-id", + name: "alexandr", + age: 38, + surname: null, + email: null, + rated: 4, + avatar: + "https://www.gravatar.com/avatar/6529e885535ef67a3fad810ad71167c2c03f79480936e9b3a714731753cbb47e?d=robohash", + friends: [ + { + id: "2", + name: "not alexandr", + surname: null, + email: null, + rated: 2, + avatar: "https://www.gravatar.com/avatar/6e?d=robohash", + }, + ], + }, + { + id: "2", + name: "not alexandr", + surname: null, + email: null, + age: 24, + rated: 5, + avatar: "https://www.gravatar.com/avatar/6e?d=robohash", + friends: [ + { + id: "some-user-id", + name: "alexandr", + surname: null, + email: null, + rated: 3, + avatar: + "https://www.gravatar.com/avatar/6529e885535ef67a3fad810ad71167c2c03f79480936e9b3a714731753cbb47e?d=robohash", + }, + ], + }, + ], + }) +}) + +module.exports = router