From 6345a62d6d5aae6e13c2b634e21cbb9e5ee9f586 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Tue, 23 Aug 2016 15:05:29 -0400 Subject: [PATCH] runs index in api --- controllers/runs.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/runs.js b/controllers/runs.js index cf7b513..b3decec 100644 --- a/controllers/runs.js +++ b/controllers/runs.js @@ -3,7 +3,10 @@ var controller = express.Router(); var Run = require('../models/runs.js'); controller.get('/', function(req, res){ - res.json(runs); + Run.findAll({}).then(function(foundRuns){ + //createdRun is the object representation of the row created in the DB + res.json(foundRuns); + }); }); controller.get('/:id', function(req, res){