-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
26 lines (22 loc) · 802 Bytes
/
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
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(path.join(__dirname, 'build')));
app.get(["/", "/resources"], (req, res) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.get("*.pdf", (req, res) => {
res.sendFile(path.join(__dirname, "lectures", req.path))
})
app.listen(process.env.PORT || 8080, process.env.HOST || "0.0.0.0", () => {
console.log(` _________________________________________
/ TJ Quantum Computing Club server up and \\
\\ running! /
-----------------------------------------
\\ ^__^
\\ (oo)\\_______
(__)\ )\\/\\
||----w |
|| ||
`)
});