sh
app.get(‘/api/user/login’, (req: any, res) => {
const data = [{ name: ‘testusername’ }];
res.status(200).send(data);
});
app.get(‘/api/user/signup’, (req, res) => {
res.send(‘Signup route’);
});

🧠 Summary: What You Learned About Middleware in Node js

  • Middleware are functions that process incoming requests

  • You can write global, route-specific, or error-handling middleware

  • Middleware in Node js helps you keep logic clean and modular

  • Standard practice is to keep your API URLs structured and RESTful