-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
33 lines (25 loc) · 860 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
32
33
var express = require("express");
var app = express();
var SERVER_ADDRESS = 'localhost';
var SERVER_PORT = 8080;
var server;
var startup = function() {
server = app.listen(SERVER_PORT, SERVER_ADDRESS, function() {
console.log("Server running at http://%s:%s", SERVER_ADDRESS, SERVER_PORT)
});
}
// Use express to serve index.htm and survey.htm
/* TODO localhost:8080/getQuestions
* GET request
* Read a json file containing survey questions and
* return them to the client. Send appropriate error
* messages if/when things don't work as expected.
*/
/* TODO localhost:8080/commitSurvey
* POST request
* Retrieve survey data from the client and store it
* somehow for future use. Send appropriate error
* messages if/when things don't work as expected.
*/
// And whatever others you need to present data from surveys.htm
startup();