azures04 335aef34e3 Add user GET endpoint, schemas, and security middlewares
Introduces GET /users/:id endpoint with validation schema, adds tests for user and register routes, and applies security middlewares (helmet, hpp, cors) to the server. Also adds ESLint configuration and updates logger with linting comments.
2025-12-22 13:26:13 +01:00

17 lines
484 B
JavaScript

const express = require("express")
const DefaultError = require("../../errors/DefaultError")
const router = express.Router()
router.get("", async (req, res) => {
const bearer = req.headers.authorization
if (bearer == "Bearer token") {
return res.status(200).json({
id: req.params.id,
username: "johndoe"
})
} else {
throw new DefaultError(403, "Invalid token", "", "InvalidTokenException")
}
})
module.exports = router