-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
65 lines (49 loc) · 1.66 KB
/
index.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const express = require("express");
const app = express();
let port = process.env.PORT || 3000;
const path = require("path");
app.get("/", (req, res) => {
res.sendFile(path.join(__dirname, "pub/examples.html"));
});
app.get("/documentation", (req, res) => {
res.sendFile(path.join(__dirname, "pub/documentation.html"));
});
app.get("/library.js", (req, res) => {
res.sendFile(path.join(__dirname, "pub/library.js"));
});
app.get("/examples.js", (req, res) => {
res.sendFile(path.join(__dirname, "pub/examples.js"));
});
app.get("/examples.css", (req, res) => {
res.sendFile(path.join(__dirname, "pub/examples.css"));
});
app.get("/documentation.css", (req, res) => {
res.sendFile(path.join(__dirname, "pub/documentation.css"));
});
app.get("/all-examples", (req, res) => {
res.sendFile(path.join(__dirname, "pub/all-examples.html"));
});
app.get("/all-examples.css", (req, res) => {
res.sendFile(path.join(__dirname, "pub/all-examples.css"));
});
app.get("/img/star.png", (req, res) => {
res.sendFile(path.join(__dirname, "pub/img/star.png"));
});
app.get("/img/tire.png", (req, res) => {
res.sendFile(path.join(__dirname, "pub/img/tire.png"));
});
app.get("/img/rocket.gif", (req, res) => {
res.sendFile(path.join(__dirname, "pub/img/rocket.gif"));
});
app.get("/img/github.png", (req, res) => {
res.sendFile(path.join(__dirname, "pub/img/github.png"));
});
app.get("/img/girl.jpg", (req, res) => {
res.sendFile(path.join(__dirname, "pub/img/girl.jpg"));
});
app.get("/img/image-2.jpg", (req, res) => {
res.sendFile(path.join(__dirname, "pub/img/image-2.jpg"));
});
app.listen(port, () => {
console.log(`Example app is listening on port http://localhost:${port}`);
});