Answer the question
In order to leave comments, you need to log in
How to transfer control from routes to node js?
There is a route
module.exports = function(app) {
app.get('/users', require('../controllers/user').CRUD.findAll);
app.get('/users/:id', require('../controllers/user').CRUD.findById);
app.post('/users/login', require('../controllers/user').handlers.login);
};
require('./routes')(app);
exports.handlers = {
login: function(req, res, next){
К ПРИМЕРУ
req.json(req.params);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question