Files
koodiklinikka.fi-api/routes/feeds.js
Cihan Bebek f783a27045 Membership registration & payment API (#4)
* remove newrelic from use in devenv

* add endpoint for membership payments

* fix some wierd spaces

* minor code styling and logging stuff

* replace non-breaking spaces with normal ones

* remove duplicate function

* minor code styling

* add functionality for writing new member to google sheets

* add config example

* update example config, start using config in google credentials

* remove var creds from google sheets auth

* rename config.example to config.template and fix readme

* add async and google-spreadsheet packages

* rename workingWithRows to addRow

* return missing header from readme

* minor code styling

* flatten google config structure, add address fields

* add request validation to membership endpoint

* fix config field names

* more error handling, fix indentation
2017-07-08 20:23:16 +01:00

24 lines
608 B
JavaScript

'use strict';
var cache = require('apicache').middleware;
var Promise = require('bluebird');
var twitter = require('../services/twitter');
var github = require('../services/github');
module.exports = function (app) {
/*
* GET /feeds
* Endpoint for fetching different information feeds (Twitter, GitHub etc.)
*/
app.get('/feeds', cache('10 minutes'), function(req, res, next) {
Promise.props({
twitter: twitter.getTweets(40),
github: github.getEvents(40)
}).then(function(data) {
res.status(200).send(data);
}, function(err) {
next(err);
});
});
};