Skip to content

Commit

Permalink
fix: Use ./ as homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Jun 9, 2023
1 parent bdf318a commit c6fd95d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions pkg/webui/staticbuilder.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package webui

import (
"bytes"
"context"
"fmt"
"github.com/kluctl/kluctl/v2/pkg/results"
Expand Down Expand Up @@ -115,16 +114,6 @@ func (swb *StaticWebuiBuilder) Build(path string) error {
return err
}

indexHtml, err := os.ReadFile(filepath.Join(tmpDir, "index.html"))
if err != nil {
return err
}
indexHtml = bytes.ReplaceAll(indexHtml, []byte("/webui/"), []byte("./"))
err = os.WriteFile(filepath.Join(tmpDir, "index.html"), indexHtml, 0)
if err != nil {
return err
}

staticbuildJsBytes, err := os.ReadFile(filepath.Join(tmpDir, "staticbuild.js"))
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/webui/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-demo",
"version": "0.1.0",
"homepage": "/",
"homepage": "./",

This comment has been minimized.

Copy link
@floatyboaty

floatyboaty May 20, 2024

this path is breaking with contexts (example: http://localhost:8080/klugui)
https://stackoverflow.com/a/44048328

This comment has been minimized.

This comment has been minimized.

Copy link
@codablock

codablock May 20, 2024

Author Collaborator

@floatyboaty thanks for reporting this. Can you create an issue for this so that we can track this?

"private": true,
"proxy": "http://localhost:8080",
"dependencies": {
Expand Down

0 comments on commit c6fd95d

Please sign in to comment.