-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (22 loc) · 707 Bytes
/
index.js
File metadata and controls
27 lines (22 loc) · 707 Bytes
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
var express = require("express"),
app = express(),
port = 3000,
publicDir = process.argv[2] || __dirname + '/public_html';
app.get("/", function (req, res) {
res.sendfile("public_html/index.html");
});
app.get("/courses", function (req, res) {
res.sendfile("public_html/index.html");
});
app.get("/404", function (req, res) {
res.sendfile("public_html/index.html");
});
app.get("/shoppingcart", function (req, res) {
res.sendfile("public_html/index.html");
});
app.get("/grades", function (req, res) {
res.sendfile("public_html/index.html");
});
app.use(express.static(publicDir));
console.log("Simple static server showing %s listening at %s", publicDir, port);
app.listen(port);