-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.express.js
69 lines (55 loc) · 1.87 KB
/
index.express.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
66
67
68
69
// eslint-disable-next-line no-undef
const express = require("express");
// eslint-disable-next-line no-undef
const path = require("path");
const app = express();
var requests = 0;
app.get("*", function(_, __, next) {
requests++;
console.log(requests);
next();
});
app.get("/", function(_, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "index.html"));
});
app.get("/aaaaaa-test", function(_, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "index.html"));
});
app.get("/test-7666", function(_, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "index.html"));
});
app.get("/test-11111111", function(_, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "index.html"));
});
app.get("/test-11111112222222222", function(_, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "index.html"));
});
app.get("*", function(_, response) {
response.status(404).end();
});
app.get("/test/asdfgh", function(_, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "index.html"));
});
app.get("/test1", async function(request, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "test1"));
});
app.get("/test2", async function(request, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "test2"));
});
app.get("/test3/test3", async function(request, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "test3"));
});
app.get("/test4--test4/test4/", async function(request, response) {
// eslint-disable-next-line no-undef
response.sendFile(path.join(process.cwd(), "test4"));
});
app.listen(3000);