ES6 Node.js Project.
What things you need to install the software and how to install them
npm
node.js
Clone this repository and run
npm install
And then
node index.js
You should now be able to access it on localhost:8080
reset() - Reset the votes in the poll
vote(ans) - Vote in determined answer
print() - print to global Array and console stats
getSubject() - Return Subject of the poll
getAnswers() - Return array with the answers
getResults() - Return object with answers as the key and votes as the values
constructor(subject,answers,maxVotes) - Send Subject, array of answers and maxVotes(default is 10)
/ - Print all the information in the Global array
/stats - lists the existing polls with the link to the single stats page
/stats/:pollId - Print the stats for a single poll