51Pushing Notes to Firebase

Some external services allow you to update data, not just read it. Firebase[5] is a service that lets you create your own database so you can save data for web, mobile, and desktop applications. And you can use it with any programming language, thanks to its JSON-based API.

Create a simple command-line application that lets you save and show notes, using Firebase to save the notes. The application should support the following commands:

  • mynotes new Learn how to invert binary trees should save the note.

  • Use mynotes show to display all of the existing notes.

Example Output

 
$ ​mynotes new Learn how to invert binary trees
 
Your note was saved.
 
 
$ ​mynotes show
 
2050-12-31 - Learn how to invert binary trees
 
2050-12-30 ...

Get Exercises for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.