Skip to content

Instantly share code, notes, and snippets.

@nataliaconde
Created August 11, 2020 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nataliaconde/3e6a75fa7f8adab71d01b2f7f623f97a to your computer and use it in GitHub Desktop.
Save nataliaconde/3e6a75fa7f8adab71d01b2f7f623f97a to your computer and use it in GitHub Desktop.
Create Controller Logic
'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