Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Add new note to Firebase
- * Real-Time Database
- */
- app.post('/addNote', (req, res)=> {
- var title = req.body.note.title;
- var body = req.body.note.body;
- var userId= req.body.note.uid;
- db.notes.push({
- title: title,
- body: body,
- uid: userId
- })
- res.send("Success")
- })
- app.get('/all', (req, res, next)=> {
- db.notes.on('value', snapshot => {
- return res.send(snapshot.val());
- })
- })
- /**
- * Add new note to Firebase
- * Real-Time Database
- */
- app.post('/addNote', (req, res)=> {
- var title = req.body.note.title;
- var body = req.body.note.body;
- var userId= req.body.note.uid;
- db.notes.push({
- title: title,
- body: body,
- uid: userId
- })
- res.send("Success")
- })
- app.get('/all', (req, res, next)=> {
- db.notes.once('value', snapshot => {
- return res.send(snapshot.val());
- })
- })
Add Comment
Please, Sign In to add comment