Created
August 11, 2020 14:47
Create Controller Logic
This file contains hidden or 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