Answer the question
In order to leave comments, you need to log in
What is the correct way to declare exports so that each time it is not written in js?
there is code in model.js
exports.findAll = function(req,res) {
}
exports.findById = function(req,res) {
}
exports
.findById
.findAll
app.get('/tester', require('../controllers/tester').findAll);
app.get('/tester/:id', require('../controllers/tester').findById);
Answer the question
In order to leave comments, you need to log in
Mmm... Maybe you are looking for
module.exports = {
findById: function() {},
findAll: function() {}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question