Dev OPinion
It is a app created for Netlify Dynamic Site challenge on Dev.
Tech stack
- Nuxt.js
- Netlify
- Netlify Blob (for storage)
This is a submission for the Netlify Dynamic Site Challenge: Build with Blobs.
I have built an online poll for the common questions between developers. Each question has two options. Users can choose any one option. The votes are recorded anonymously.
The demo is available here - devopinion.netlify.app
Source Code on GitHub -
It is a app created for Netlify Dynamic Site challenge on Dev.
I have used Netlify Blobs to store the votes for each question.
Each blob holds a JSON array of votes for each option. Below is an example of data stored in a blob.
[341, 1231]
Here, the first element in the array is the number of votes for the first option and the second element is a number of votes for the second option.
I have used the setJSON
method to set the value as json in the blob.
await store.setJSON(key, [131, 231]);
To get the value as JSON I have used the following code
await store.get(key, {
type: "json",
});
I have used the Netlify functions as API to fetch and add votes in the blob storage.