-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
41 lines (36 loc) · 1.3 KB
/
server.js
File metadata and controls
41 lines (36 loc) · 1.3 KB
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
34
35
36
37
38
39
40
41
var express = require("express");
var app = express();
app.use(express.static("dist"));
app.use(express.static("KyleBonar_2015/"));
// app.use(express.static('src/images'));
// app.set('views', './build');
//Send Resume
app.get("/resume", function (req, res) {
res.sendFile(`${process.cwd()}/src/images/profile/Davis_Kyle_09FEB2020.pdf`);
});
//Send specific JavaScript game
app.get("/JSGames/doublePend", function (req, res) {
res.sendFile(`${process.cwd()}/JSGames/doublePend/index.html`);
});
app.get("/JSGames/fractalTrees", function (req, res) {
res.sendFile(`${process.cwd()}/JSGames/fractalTrees/index.html`);
});
app.get("/JSGames/phyllotaxis", function (req, res) {
res.sendFile(`${process.cwd()}/JSGames/phyllotaxis/index.html`);
});
app.get("/JSGames/pong", function (req, res) {
res.sendFile(`${process.cwd()}/JSGames/pong/index.html`);
});
app.get("/JSGames/wordCount", function (req, res) {
res.sendFile(`${process.cwd()}/JSGames/wordCount/index.html`);
});
app.get("/KyleBonar_2015", function (req, res) {
res.sendFile(`${process.cwd()}/KyleBonar_2015/index.html`);
});
//rest will fall here and be handled by react app
app.get("*", function (req, res) {
res.sendFile(`${process.cwd()}/dist/index.html`);
});
app.listen(5000, function () {
console.log("Example app listening on port 5000!");
});