-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding query,facts,video functions #4
base: master
Are you sure you want to change the base?
Conversation
functions/index.js
Outdated
//<--------Random Fact Generation----------> | ||
//Generates random fact about techspardha. | ||
exports.randomFact = functions.https.onRequest((request , response) => { | ||
const numberOfLines = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to change it as per the number of facts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
functions/index.js
Outdated
}); | ||
}); | ||
}); | ||
response.status(401).json(items); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think directly returning snapshot.val() should work. no need to iterate and make separate object
functions/index.js
Outdated
//only add newly asked query to the database. | ||
exports.addQuery = functions.https.onRequest((request,response)=>{ | ||
const query = request.query.text; | ||
var newPostKey = admin.database().ref().child('queries').push().key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validate query if not null.
Need to add captcha validation.
Directly push into reference, why building a separate object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add caching also
No description provided.