Created
November 14, 2016 16:08
-
-
Save Juraci/31f8bbf1abb451974cd030d7942b498a to your computer and use it in GitHub Desktop.
After transpiling with es2015 preset
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'; | |
Object.defineProperty(exports, "__esModule", { | |
value: true | |
}); | |
var _express = require('express'); | |
var _express2 = _interopRequireDefault(_express); | |
var _bodyParser = require('body-parser'); | |
var _bodyParser2 = _interopRequireDefault(_bodyParser); | |
var _goals = require('../controllers/goals'); | |
var _goals2 = _interopRequireDefault(_goals); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var router = _express2.default.Router(); | |
var jsonParser = _bodyParser2.default.json(); | |
exports.default = function (datasource) { | |
var Goal = datasource.models.Goal; | |
var goalsController = new _goals2.default(Goal); | |
router.route('/').get(function (req, res) { | |
goalsController.findAll().then(function (result) { | |
res.status(result.status).json(result.data); | |
}); | |
}); | |
return router; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment