Przeglądaj źródła

feature: 修改publicPath

chenqinghe 4 lat temu
rodzic
commit
514d283dfd
3 zmienionych plików z 8 dodań i 4 usunięć
  1. 3
    1
      Dockerfile
  2. 2
    1
      cmd/webpprof/main.go
  3. 3
    2
      web/vue.config.js

+ 3
- 1
Dockerfile Wyświetl plik

35
 
35
 
36
 EXPOSE 8090
36
 EXPOSE 8090
37
 
37
 
38
-ENTRYPOINT ["/app/webpprof"]
38
+WORKDIR /app
39
+
40
+ENTRYPOINT ["./webpprof"]

+ 2
- 1
cmd/webpprof/main.go Wyświetl plik

18
 func main() {
18
 func main() {
19
 	r := gin.Default()
19
 	r := gin.Default()
20
 
20
 
21
-	r.Static("/", "html")
21
+	r.Static("/html", "html")
22
 
22
 
23
+	r.GET("/", func(c *gin.Context) { c.Redirect(http.StatusFound, "/html/") })
23
 	r.POST("/upload", upload)
24
 	r.POST("/upload", upload)
24
 	r.GET("/pprof/:hash/:method", mapping)
25
 	r.GET("/pprof/:hash/:method", mapping)
25
 
26
 

+ 3
- 2
web/vue.config.js Wyświetl plik

3
     // 选项...
3
     // 选项...
4
     devServer: {
4
     devServer: {
5
         proxy: 'http://localhost:8090'
5
         proxy: 'http://localhost:8090'
6
-    }
7
-}
6
+    },
7
+    publicPath: '/html'
8
+}