<commit_before>var express = require('express');
var router = express.Router();

router.get('/summary', function(req, res, next) {
  res.json({
  	'totals': {},
  	'activities': []
  });
});

module.exports = router;<commit_msg>Return Fitbit data at activity endpoint<commit_after>var express = require('express');
var router = express.Router();

var Fitbit = require('../model/fitbit');
var Strava = require('../model/strava');
var _ = require('underscore');

router.get('/activity', function(req, res, next) {
	if (!req.query.date) return next(new Error('date param is required'));
	var dateObj = new Date(req.query.date);

	Fitbit.findOne({dateTime: dateObj}, function(err, data) {
		if (err) return next(err);
		res.json({
			'date': req.query.date,
			'summary': _.pick(data, globalConfig.fitbit.exposed),
			'workouts': []
		});
	});
	
});

module.exports = router;
{'fraction_non_alphanumeric': 0.1928817451205511, 'fraction_numerical': 0.0, 'mean_word_length': 4.699346405228758, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4373132', 'n_tokens_mistral': 301, 'n_tokens_neox': 286, 'n_words': 66}