编写一个React Native App,允许用户使用Register
,Login
,Update Account Info
, Post (Each post contains a short message with 1500 chars or less and/or up to 9 images)
和Download Posts
。我可以在不使用云功能的情况下完成所有这些任务,但我想知道哪种方法更好,为什么?我应该为每个http请求使用firebase云功能吗?
例如,Set user's account info
,我可以做这样的事情在我的应用程序:
firebase.database().ref(`users/${uid}`)
.set({
firstName: 'Stack',
lastName: 'Overflow'
});
或者我可以简单地写一个火力点云功能,每次我想设置一个用户的帐户信息,我可以做这样的事情:
const SET_ACCOUNT_URL = 'https://firebase.set_account_url.com';
axios.post(SET_ACCOUNT_URL, {
firstName: 'Stack',
lastName: 'Overflow'
})
.then(() => ...Do Something Here...)
.catch((error) => console.log(error));
哪种方法更好,为什么?
非常感谢你,我确实这样想,但只是想确定一下。这非常有帮助! –