feed -> news; - api/
This commit is contained in:
1 parent
22edc3b275
commit
02906582ac
5 files changed
+7
-7
No files matched your search
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
module.exports = function(app) {
|
module.exports = function(app) {
|
||||||
app.factory("api", function ($http) {
|
app.factory("api", function ($http) {
|
||||||
var api = {};
|
var api = {};
|
||||||
var Endpoint = require("./feed");
|
var Endpoint = require("./news");
|
||||||
api.feed = new Endpoint($http);
|
api.news = new Endpoint($http);
|
||||||
|
|
||||||
return api;
|
return api;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ function APIFeed(http){
|
|||||||
this.request = http;
|
this.request = http;
|
||||||
}
|
}
|
||||||
|
|
||||||
APIFeed.prototype.post = function() {
|
APIFeed.prototype.feed = function() {
|
||||||
return this.request.get("/api/feed");
|
return this.request.get("/news");
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = APIFeed;
|
module.exports = APIFeed;
|
||||||
@@ -39,7 +39,7 @@ module.exports = function(app) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
controller: function($scope, api){
|
controller: function($scope, api){
|
||||||
api.feed.post()
|
api.news.feed()
|
||||||
.success(function (list) {
|
.success(function (list) {
|
||||||
$scope.feed = list.map(function (post) {
|
$scope.feed = list.map(function (post) {
|
||||||
var author_id = personByInstagram(team.team, post.data.user.username);
|
var author_id = personByInstagram(team.team, post.data.user.username);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ var route = require("koa-route");
|
|||||||
var db = require("../core/db");
|
var db = require("../core/db");
|
||||||
|
|
||||||
module.exports = function (app) {
|
module.exports = function (app) {
|
||||||
app.use(route.get("/api/feed", function *(){
|
app.use(route.get("/news", function *(){
|
||||||
this.body = yield db.c("posts").find().toArray();
|
this.body = yield db.c("posts").find().toArray();
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
@@ -43,8 +43,8 @@ app.use(route.get("/document/:doc", routes.index(
|
|||||||
path.join(__dirname, "templates/document.html")
|
path.join(__dirname, "templates/document.html")
|
||||||
)));
|
)));
|
||||||
|
|
||||||
require("./api/feed")(app);
|
|
||||||
require("./routes/schedule")(app);
|
require("./routes/schedule")(app);
|
||||||
|
require("./routes/news")(app);
|
||||||
|
|
||||||
module.exports = function (port) {
|
module.exports = function (port) {
|
||||||
app.listen(port);
|
app.listen(port);
|
||||||
|
|||||||
Reference in new issue
Block a user