forked from cs4241-20a/a4-creative-coding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
29 lines (22 loc) · 699 Bytes
/
server.js
File metadata and controls
29 lines (22 loc) · 699 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
28
29
// server.js
// where your node app starts
const express = require("express");
const app = express();
app.set("views", __dirname + "/public/views");
app.use(express.static(__dirname + "/public"));
app.set("view engine", "ejs");
app.get("/", function(request, response) {
response.render("normal");
});
app.get("/easy", function(request, response) {
response.render("easy.ejs");
});
app.get("/normal", function(request, response) {
response.render("normal.ejs");
});
app.get("/hard", function(request, response) {
response.render("hard.ejs");
});
const listener = app.listen(process.env.PORT, function() {
console.log("Your app is listening on port " + listener.address().port);
});