-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.tsx
72 lines (63 loc) · 2.34 KB
/
main.tsx
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
70
71
72
import { main, suspend } from "effection";
import { createRevolution, route } from "revolution";
// Routes
import { proxyRoute } from "./routes/proxy-route.ts";
import { assetsRoute } from "./routes/assets-route.ts";
import { indexRoute } from "./routes/index.tsx";
import { backstageServicesRoute } from "./routes/backstage.html.tsx";
import { dxConsultingServicesRoute } from "./routes/dx-consulting.html.tsx";
import { pluginWorkshopRoute } from "./routes/advanced-backstage-plugin-development-route.tsx";
import { resideoBackstageCaseStudyRoute } from "./routes/work/case-studies/case-study-resideo.html.tsx";
import { etagPlugin } from "./plugins/etag.ts";
import { currentRequestPlugin } from "./plugins/current-request.ts";
import { twindPlugin } from "./plugins/twind.ts";
import { config } from "./twind.config.ts";
await main(function* () {
let proxies = proxySites();
let revolution = createRevolution({
app: [
route("/", indexRoute()),
route("/backstage", backstageServicesRoute()),
route("/dx-consulting", dxConsultingServicesRoute()),
route("/work/case-studies/resideo", resideoBackstageCaseStudyRoute()),
route(
"/workshops/advanced-backstage-plugin-development",
pluginWorkshopRoute(),
),
route("/effection(.*)", proxyRoute(proxies.effection)),
route("/graphgen(.*)", proxyRoute(proxies.graphgen)),
route("/assets(.*)", assetsRoute("assets")),
route("/interactors(.*)", proxyRoute(proxies.interactors)),
proxyRoute(proxies.legacy),
],
plugins: [
etagPlugin(),
currentRequestPlugin(),
twindPlugin({ config }),
],
});
let server = yield* revolution.start({ port: 8005 });
console.log(`www -> http://${server.hostname}:${server.port}`);
yield* suspend();
});
function proxySites() {
return {
effection: {
prefix: "effection",
website: Deno.env.get("EFFECTION_URL") ?? "https://effection.deno.dev",
},
interactors: {
prefix: "interactors",
root: "interactors/",
website: Deno.env.get("INTERACTORS_URL") ?? "https://interactors.deno.dev"
},
graphgen: {
prefix: "graphgen",
website: Deno.env.get("GRAPHGEN_URL") ?? "https://graphgen.deno.dev",
},
legacy: {
prefix: "",
website: Deno.env.get("FS_LEGACY_URL") ?? "https://frontside.netlify.app",
},
} as const;
}