-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
33 lines (31 loc) · 1.13 KB
/
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
// Dependencies
// =============================================================
var express = require("express");
var path = require("path");
// Sets up the Express App
// =============================================================
var app = express();
var PORT = process.env.PORT || 3000;
app.use(express.static(path.join(__dirname, 'public')));
app.get("/", function(req, res) {
res.sendFile(path.join(__dirname, "/public/index.html"));
});
app.get("/index.html", function(req, res) {
res.sendFile(path.join(__dirname, "/public/index.html"));
});
app.get("/about.html", function(req, res) {
res.sendFile(path.join(__dirname, "/public/about.html"));
});
app.get("/web-design.html", function(req, res) {
res.sendFile(path.join(__dirname, "/public/web-design.html"));
});
app.get("/photography.html", function(req, res) {
res.sendFile(path.join(__dirname, "/public/photography.html"));
});
app.get("/writing.html", function(req, res) {
res.sendFile(path.join(__dirname, "/public/writing.html"));
});
//initilize server
app.listen(PORT, function() {
console.log("App listening on PORT " + PORT);
});