forked from getsentry/sentry-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
65 lines (60 loc) · 1.72 KB
/
server.js
File metadata and controls
65 lines (60 loc) · 1.72 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
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 { createProxyMiddleware } = require("http-proxy-middleware");
const PORT = parseInt(process.env.PORT, 10) || 3000;
const app = express();
const routes = [
{
// this should match what's in nginx.conf
routes: [
"/assets",
"/platforms",
"/clients",
"/error-reporting",
"/performance-monitoring",
"/api",
"/guides",
"/sdks",
"/ssl",
"/_platforms"
],
address: "http://localhost:9001"
},
{
routes: ["/"],
address: "http://localhost:9002"
}
];
for (route of routes) {
app.use(
route.routes,
createProxyMiddleware({
target: route.address
})
);
}
app.listen(PORT, () => {
console.log("\x1b[32m%s\x1b[0m", `-----------------------------------------`);
console.log("\x1b[32m%s\x1b[0m", `-----------------------------------------`);
console.log("\x1b[32m%s\x1b[0m", `-----------------------------------------`);
console.log("\x1b[32m%s\x1b[0m", `-----------------------------------------`);
console.log(
"\x1b[32m%s\x1b[0m",
`Open to see the docs http://localhost:${PORT}`
);
console.log(
"\x1b[32m%s\x1b[0m",
`Open to see the docs http://localhost:${PORT}`
);
console.log(
"\x1b[32m%s\x1b[0m",
`Open to see the docs http://localhost:${PORT}`
);
console.log(
"\x1b[32m%s\x1b[0m",
`Open to see the docs http://localhost:${PORT}`
);
console.log("\x1b[32m%s\x1b[0m", `-----------------------------------------`);
console.log("\x1b[32m%s\x1b[0m", `-----------------------------------------`);
console.log("\x1b[32m%s\x1b[0m", `-----------------------------------------`);
console.log("\x1b[32m%s\x1b[0m", `-----------------------------------------`);
});