+ 2
What is the best way to code a voting system using javascript
I have a website with 14 pictures and I want to be able to code a way to vote on your favorite picture and show the results but I'm really not sure how to go about it at all. What is a way to achieve this or something similar to this. I am using an external javascript file in notepad to code all my javascript.
8 Réponses
+ 4
For simple voting data, you could use json server on nodejs server to build rest-api data.
Frontend javascript can then read or write the server json file by using api fetch or axios.
Server side coding:
https://glitch.com/~voting-sl-cources
Rest api endpoint:
https://voting-sl-cources.glitch.me/courses
Frontend Sololearn code
https://code.sololearn.com/WuSBUcgTWH8m/?ref=app
+ 4
There's also this 😅
https://code.sololearn.com/WQYApZt67VWn/?ref=app
+ 4
Can't see server side source code on glitch
+ 2
Adi Pratama-Universitas Brawijaya server run by json server, it only needs to have db.json to setup rest api.
+ 1
If you know Python, then u can use Django as the back end
0
Thank you everyone!