From 9a349675e8411c0f5cf442a3a820fcd5a9585a4c Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sun, 14 Aug 2016 14:55:39 -0400 Subject: [PATCH] run index and create routes --- controllers/runs.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/controllers/runs.js b/controllers/runs.js index 42bdcc0..03aeb52 100644 --- a/controllers/runs.js +++ b/controllers/runs.js @@ -2,7 +2,12 @@ var controller = require('express').Router(); var runs = require('../models/run.js'); controller.get('/', function(req, res){ - res.send('oh hai!'); -}) + res.json(runs); +}); + +controller.post('/', function(req, res){ + runs.push(req.body); + res.json(runs); +}); module.exports = controller;