forked from IntroHCI/lab2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
10,036 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: node server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
lab2 | ||
Lab 2 | ||
==== | ||
|
||
Lab 2 for Intro to HCI | ||
Lab 2 introduces you to static HTML, CSS, and Bootstrap. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "cs147-lab-1", | ||
"description": "Serving static content via html files", | ||
"version": "0.0.1", | ||
"author": "CS147 Staff <[email protected]>", | ||
|
||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/StanfordHCI/cs147" | ||
}, | ||
"license": "MIT", | ||
|
||
"main": "server.js", | ||
"dependencies": { | ||
"express": "3.x" | ||
}, | ||
"engines": { | ||
"node": "0.10.x" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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); | ||
}); |
Oops, something went wrong.