A sample JavaScript server, which provides generic access to fetch & update firestore collections. I've developed and used this project as a backend server to my Lender Tracker App project.
This repository can give you an easy access to your firestore collections via REST API, eliminating the hassle of accessing your managing and accessing your data.
Sub-collections are currently not supported.
In my firestore project, I've got a collection named items
.
One may query this collection using the following paths:
Path | Description |
---|---|
/api/items |
Fetch all items in the items collection |
/api/items/BOLI2758 |
Fetch the item with the ID BOLI2758 from the items collection |
/api/items?name=Book |
Fetch all items with the field name: Book from the items collection |
And can also update the data using regular JSON body in an HTTP POST request:
axios({
method: 'post',
url: '/api/items',
data: {
name: 'Pencil',
ownerName: 'Williams'
}
});
Make sure to fill your own firebase config in connector.js. Go to the root directory and run the following command:
npm start