-
Notifications
You must be signed in to change notification settings - Fork 18
/
server.js
31 lines (17 loc) · 976 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Require the Express module (https://npmjs.com/package/express)
// Create a new express application instance by calling `express()`
// Serve files in the 'public' directory with Express's built-in static file server
// Create a Counter class that will be used to create counter objects
// See the full description in README.md
// Create a new Counter instance, like: `var voteCounter = new Counter()`
// Respond to 'get' requests for the route '/kittens'
// - Record a vote for 'kittens'
// - Retrieve the new cumulative votes for 'kittens'
// - Respond with with the message:
// "Thank you for voting! Kittens have 12 total votes so far."
// Respond to 'get' requests for the route '/puppies'
// - Record a vote for 'puppies'
// - Retrieve the new cumulative votes for 'puppies'
// - Respond with with the message:
// "Thank you for voting! Puppies have 12 total votes so far."
// Have the Express application listen for incoming requests on port 8080