Commit caefdd8 1 parent 8ffffe8 commit caefdd8 Copy full SHA for caefdd8
File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package main
2
2
3
3
import (
4
4
"bufio"
5
+ "embed"
6
+ "io/fs"
5
7
"net"
6
8
"net/http"
7
9
"os"
@@ -13,6 +15,9 @@ import (
13
15
"gopkg.in/gin-contrib/cors.v1"
14
16
)
15
17
18
+ //go:embed dashboard/reaper
19
+ var dashboardAssets embed.FS
20
+
16
21
func isRunningInDockerContainer () bool {
17
22
// slightly modified from blog: https://paulbradley.org/indocker/
18
23
// docker creates a .dockerenv file at the root
@@ -53,6 +58,14 @@ func StartAPIServer(config *Config,
53
58
54
59
router .Use (cors .Default ())
55
60
61
+ router .GET ("/" , func (c * gin.Context ) {
62
+ c .Redirect (http .StatusTemporaryRedirect , "/dashboard" )
63
+ c .Abort ()
64
+ })
65
+
66
+ dashboardAssets , _ := fs .Sub (dashboardAssets , "dashboard/reaper" )
67
+ router .StaticFS ("/dashboard" , http .FS (dashboardAssets ))
68
+
56
69
router .GET ("/blockcache" , func (c * gin.Context ) {
57
70
special := make ([]string , 0 , len (blockCache .Special ))
58
71
for k := range blockCache .Special {
You can’t perform that action at this time.
0 commit comments