Created
August 11, 2020 14:47
-
-
Save nataliaconde/3e6a75fa7f8adab71d01b2f7f623f97a to your computer and use it in GitHub Desktop.
Create Controller Logic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var properties = required('../package.json'); | |
var distance = require('../service/distance'); | |
var controllers = { | |
about: function(req,res){ | |
var aboutInfo = { name:properties.name, version: properties.version } | |
res.json(aboutInfo); | |
}, | |
get_distance: function(req, res){ | |
distance.find(req, res, function(err,dist){ | |
if(err) res.send(err); res.json(dist); | |
}); | |
}, | |
}; | |
module.exports = controllers; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment