Skip to content

Commit

Permalink
fix(api): fixed some api source mapping issue
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotcourant committed Apr 13, 2024
1 parent 84a7984 commit 34aca84
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/internal/source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package source
import (
"embed"
"fmt"
"path"
"runtime"
"strings"
)
Expand All @@ -21,7 +22,7 @@ func init() {
}
}

func transformFileName(path string) string {
newPath := strings.TrimPrefix(path, basePath)
return fmt.Sprintf("/embed/%s.txt", newPath)
func transformFileName(filePath string) string {
newPath := strings.TrimPrefix(filePath, basePath)
return fmt.Sprintf("%s.txt", path.Join("/embed/", newPath))
}

0 comments on commit 34aca84

Please sign in to comment.