From 02906582ac9864aef65469ec566faadd0f77fb27 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Sun, 1 Mar 2015 02:59:49 +0300 Subject: [PATCH] feed -> news; - api/ --- client/api/api.js | 4 ++-- client/api/{feed.js => news.js} | 4 ++-- client/ui/timeline.js | 2 +- api/feed.js => routes/news.js | 2 +- server.js | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) rename client/api/{feed.js => news.js} (60%) rename api/feed.js => routes/news.js (81%) diff --git a/client/api/api.js b/client/api/api.js index 06677e4b..18d7fc3f 100644 --- a/client/api/api.js +++ b/client/api/api.js @@ -5,8 +5,8 @@ module.exports = function(app) { app.factory("api", function ($http) { var api = {}; - var Endpoint = require("./feed"); - api.feed = new Endpoint($http); + var Endpoint = require("./news"); + api.news = new Endpoint($http); return api; }); diff --git a/client/api/feed.js b/client/api/news.js similarity index 60% rename from client/api/feed.js rename to client/api/news.js index d9e563e9..870efecb 100644 --- a/client/api/feed.js +++ b/client/api/news.js @@ -6,8 +6,8 @@ function APIFeed(http){ this.request = http; } -APIFeed.prototype.post = function() { - return this.request.get("/api/feed"); +APIFeed.prototype.feed = function() { + return this.request.get("/news"); }; module.exports = APIFeed; \ No newline at end of file diff --git a/client/ui/timeline.js b/client/ui/timeline.js index a4389020..e5f2cc74 100644 --- a/client/ui/timeline.js +++ b/client/ui/timeline.js @@ -39,7 +39,7 @@ module.exports = function(app) { } }, controller: function($scope, api){ - api.feed.post() + api.news.feed() .success(function (list) { $scope.feed = list.map(function (post) { var author_id = personByInstagram(team.team, post.data.user.username); diff --git a/api/feed.js b/routes/news.js similarity index 81% rename from api/feed.js rename to routes/news.js index e5e8dad3..bf4dd4d3 100644 --- a/api/feed.js +++ b/routes/news.js @@ -6,7 +6,7 @@ var route = require("koa-route"); var db = require("../core/db"); 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(); })); }; \ No newline at end of file diff --git a/server.js b/server.js index d98fb5c5..7393c112 100644 --- a/server.js +++ b/server.js @@ -43,8 +43,8 @@ app.use(route.get("/document/:doc", routes.index( path.join(__dirname, "templates/document.html") ))); -require("./api/feed")(app); require("./routes/schedule")(app); +require("./routes/news")(app); module.exports = function (port) { app.listen(port);