diff --git a/functions/index.js b/functions/index.js index 737d44f..97ab31b 100644 --- a/functions/index.js +++ b/functions/index.js @@ -44,7 +44,7 @@ app.get("/user", fbAuth, getAuthenticatedUser); /*------------------------------------------------------------------* * handlers/post.js * *------------------------------------------------------------------*/ -const { getallPostsforUser, putPost +const { getallPostsforUser, putPost, getAllPosts } = require("./handlers/post"); app.get("/getallPostsforUser", getallPostsforUser); @@ -52,6 +52,9 @@ app.get("/getallPostsforUser", getallPostsforUser); // Adds one post to the database app.post("/putPost", fbAuth, putPost); +// Displays posts on home page +app.post("/getAllPosts", getAllPosts ); + /*------------------------------------------------------------------* * handlers/topic.js * *------------------------------------------------------------------*/ diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js index 8d0ca4d..7ea0871 100644 --- a/twistter-frontend/src/pages/user.js +++ b/twistter-frontend/src/pages/user.js @@ -71,7 +71,7 @@ class user extends Component { }) }) .catch(err => console.log(err)); - axios.get('/posts') + axios.get('/getAllPosts') .then(res => { this.setState({ posts: res.data