forked from IntroHCI/lab1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
executable file
·31 lines (26 loc) · 862 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
/**
* Introduction to Human-Computer Interaction
* Lab 1
* --------------
* Created by: Michael Bernstein
* Last updated: December 2013
*/
var PORT = 3000;
// Express is a web framework for node.js
// that makes nontrivial applications easier to build
var express = require('express');
// Create the server instance
var app = express();
// Print logs to the console and compress pages we send
app.use(express.logger());
app.use(express.compress());
// Return all pages in the /static directory
// whenever they are requested at '/'
// e.g., http://localhost:3000/index.html
// maps to /static/index.html on this machine
app.use(express.static(__dirname + '/static'));
// Start the server
var port = process.env.PORT || PORT; // 80 for web, 3000 for development
app.listen(port, function() {
console.log("Node.js server running on port %s", port);
});