This folder contains your services. 'Services' are similar to controller actions but are typically used for things that don't necessarily have to happen between the time when the user sends a request and when the server sends back a response. Any logic that doesn't rely on .req()
and .res()
can be turned into a service if for no other reason than to keep your controllers clean and manageable.
Hypothetically, one could create a service for
Services are written in one or more .js file within this directory.
module.exports = {
send: function(to,from,body){
// fancy code that sends an email
}
}
You would call this service with Email.send('rick','bill','lol')
Mind your case. Email.send !== email.send