Files
koodiklinikka.fi-api/routes/members.js
Juuso Tapaninen ee7fd0be68 Refactored feeds in to services
Changed members route to use the GitHub service for data fetching
2015-02-02 23:11:56 +02:00

20 lines
431 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
var github = require('../services/github');
var cache = require('apicache').middleware;
module.exports = function (app) {
/*
* POST /members
* Endpoint for fetching GitHub org public members
*/
app.get('/members', cache('3 hours'), function(req, res, next) {
github.getMembers().then(function(data) {
res.status(200).send(data);
}, function(error) {
next(error);
});
});
};