Merge branch 'master' into edit-profile-info

This commit is contained in:
Clayton Wilson
2019-09-29 21:33:41 -04:00
committed by GitHub
36 changed files with 4770 additions and 1947 deletions

View File

@@ -1,13 +1,18 @@
/* eslint-disable promise/always-return */
const functions = require('firebase-functions');
const app = require('express')();
const cors = require('cors');
app.use(cors());
const FBAuth = require('./util/FBAuth');
/*------------------------------------------------------------------*
* users.js *
* handlers/users.js *
*------------------------------------------------------------------*/
const {getProfileInfo, updateProfileInfo} = require('./handlers/users');
const {getUserDetails, getProfileInfo, updateProfileInfo} = require('./handlers/users');
// Returns all data in the users collection
app.get('/getUser/:handle', getUserDetails);
// Returns all profile data of the currently logged in user
// TODO: Add FBAuth
@@ -17,5 +22,13 @@ app.get('/getProfileInfo', getProfileInfo);
// TODO: Add FBAuth
app.post('/updateProfileInfo', updateProfileInfo);
/*------------------------------------------------------------------*
* handlers/post.js *
*------------------------------------------------------------------*/
const {putPost} = require('./handlers/post');
// Adds one post to the database
app.post('/putPost', FBAuth, putPost);
exports.api = functions.https.onRequest(app);