Skip to content

Commit de2eff0

Browse files
authored
Support serving diag ui from subfolders
1 parent 09ccb95 commit de2eff0

File tree

12 files changed

+26
-22
lines changed

12 files changed

+26
-22
lines changed

samples/web/web.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ func main() {
3333
// }
3434

3535
// Start diagnostic server
36-
go http.ListenAndServe(":8080", web.NewMux(b))
36+
m := http.NewServeMux()
37+
// m.Handle("/diag", http.StripPrefix("/diag", web.NewMux(b)))
38+
m.Handle("/", web.NewMux(b))
39+
go http.ListenAndServe(":8080", m)
3740

3841
// Run worker
3942
w := RunWorker(ctx, b)

web/app/build/asset-manifest.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"files": {
3-
"main.css": "/static/css/main.8b0db0ad.css",
4-
"main.js": "/static/js/main.b40cb526.js",
5-
"index.html": "/index.html",
6-
"main.8b0db0ad.css.map": "/static/css/main.8b0db0ad.css.map",
7-
"main.b40cb526.js.map": "/static/js/main.b40cb526.js.map"
3+
"main.css": "./static/css/main.8b0db0ad.css",
4+
"main.js": "./static/js/main.99032ea1.js",
5+
"index.html": "./index.html",
6+
"main.8b0db0ad.css.map": "./static/css/main.8b0db0ad.css.map",
7+
"main.99032ea1.js.map": "./static/js/main.99032ea1.js.map"
88
},
99
"entrypoints": [
1010
"static/css/main.8b0db0ad.css",
11-
"static/js/main.b40cb526.js"
11+
"static/js/main.99032ea1.js"
1212
]
1313
}

web/app/build/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>go-workflows</title><script defer="defer" src="/static/js/main.b40cb526.js"></script><link href="/static/css/main.8b0db0ad.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>go-workflows</title><script defer="defer" src="./static/js/main.99032ea1.js"></script><link href="./static/css/main.8b0db0ad.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

web/app/build/static/js/main.b40cb526.js renamed to web/app/build/static/js/main.99032ea1.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

web/app/build/static/js/main.99032ea1.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/app/build/static/js/main.b40cb526.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

web/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
]
4848
},
4949
"proxy": "http://localhost:8080",
50+
"homepage": ".",
5051
"devDependencies": {
5152
"@types/react-router-bootstrap": "^0.24.5",
5253
"rimraf": "3.0.2"

web/app/public/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
65
<meta name="viewport" content="width=device-width, initial-scale=1" />
76
<meta name="theme-color" content="#000000" />
87
<title>go-workflows</title>

web/app/src/Home.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { Link, useLocation } from "react-router-dom";
1+
import React from "react";
22
import { Pagination, Table } from "react-bootstrap";
3-
3+
import useFetch from "react-fetch-hook";
44
import { LinkContainer } from "react-router-bootstrap";
5-
import React from "react";
5+
import { Link, useLocation } from "react-router-dom";
66
import { WorkflowInstanceRef } from "./client";
7-
import useFetch from "react-fetch-hook";
87

98
function useQuery() {
109
const { search } = useLocation();
@@ -20,7 +19,9 @@ function Home() {
2019
const previousId = query.get("previous");
2120

2221
const { isLoading, data, error } = useFetch<WorkflowInstanceRef[]>(
23-
`/api?count=${count}` + (afterId ? `&after=${afterId || previousId}` : "")
22+
document.location.pathname +
23+
`api/?count=${count}` +
24+
(afterId ? `&after=${afterId || previousId}` : "")
2425
);
2526

2627
return (

0 commit comments

Comments
 (0)