I was trying to create a middleware function for my object and I ran across this code. I was wondering the complete syntax of this code.
I understand that this makes a get request to the router named "test". Afterwards, when it executes the function that takes (req, res) inputs and if it is successful it outputs a response message object "user works"
Is my understanding correct?
// sends it to the route /test
router.get("/test", (req, res) => res.json({msg: "Users Works"}));