created function to add topic

This commit is contained in:
Leon Liang 2019-10-24 22:42:46 -04:00
parent de38339cad
commit 5405d96150

View File

@ -44,11 +44,22 @@ app.get("/user", fbAuth, getAuthenticatedUser);
/*------------------------------------------------------------------*
* handlers/post.js *
*------------------------------------------------------------------*/
const { getallPostsforUser, putPost } = require("./handlers/post");
const { getallPostsforUser, putPost
} = require("./handlers/post");
app.get("/getallPostsforUser", getallPostsforUser);
// Adds one post to the database
app.post("/putPost", fbAuth, putPost);
/*------------------------------------------------------------------*
* handlers/topic.js *
*------------------------------------------------------------------*/
const { putTopic
} = require("./handlers/topic");
// add topic to database
app.post("/putTopic", fbAuth, putTopic);
exports.api = functions.https.onRequest(app);