flocore-node/app/controllers/index.js
2014-12-04 15:53:04 -03:00

28 lines
537 B
JavaScript

'use strict';
var config = require('../../config/config');
var _getVersion = function() {
var pjson = require('../../package.json');
return pjson.version;
};
exports.render = function(req, res, next) {
if (config.publicPath) {
return res.sendfile(config.publicPath + '/index.html', {}, function(err) {
return next();
});
}
var version = _getVersion();
res.send('insight API v' + version);
};
exports.version = function(req, res) {
var version = _getVersion();
res.json({
version: version
});
};