Reputation: 175
Not sure where to start on this one, so here goes.
After creating a document in Firestore by POSTing data the user inputs in my React application state, how can I create a unique URL that a user can visit to GET/view that data?
For example:
https://myreactwebsite.com/new-document/
I need to ensure that a unique URL exists in my website index, so that not only can a user visit, but it can be indexed by Google for SEO.
My React application is hosted on Firebase as well as using Firestore for the database.
Upvotes: 1
Views: 350
Reputation: 441
Firestore is a NoSQL Document database (Much like MongoDB if you're familiar with it). They both implement some form of document ID in each document. That could be leveraged in creating a unique route in your use case.
I would create a route such as /profile/:id
in your react app, that when you visit it you make a call to your backend requesting that profile and then use the response from that request to fill in the data.
I would try to describe it here but in all honesty, this page does a much better job than I could in one short SO post
Upvotes: 1