Merge pull request #222 from dikstub-rssa/fix/anything-moko
update logo
This commit is contained in:
No files matched your search
@@ -48,7 +48,7 @@
|
|||||||
<table style="width: 100%; border-collapse: collapse">
|
<table style="width: 100%; border-collapse: collapse">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center">
|
<td style="text-align: center">
|
||||||
<img src="assets/docs/logo-provinsi-jawa-timur.png" alt="logo" style="height: 70px" />
|
<img src="/assets/docs/logo-provinsi-jawa-timur.png" alt="logo" style="height: 70px" />
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: center">
|
<td style="text-align: center">
|
||||||
<div style="font-size: 14px; font-weight: bold">
|
<div style="font-size: 14px; font-weight: bold">
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<div>Website: www.rsudsaifulanwar.jatimprov.go.id</div>
|
<div>Website: www.rsudsaifulanwar.jatimprov.go.id</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: center">
|
<td style="text-align: center">
|
||||||
<img src="assets/docs/logo-rssa.png" alt="logo" style="height: 70px" />
|
<img src="/assets/docs/logo-rssa.png" alt="logo" style="height: 70px" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package assets
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
)
|
||||||
|
|
||||||
|
func exeDir() string {
|
||||||
|
exe, err := os.Executable()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return filepath.Dir(exe)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetAssetsDir() string {
|
||||||
|
exe, err := os.Executable()
|
||||||
|
if err != nil {
|
||||||
|
log.Println(
|
||||||
|
"[ASSETS][ERROR] Failed to resolve executable path.",
|
||||||
|
"This should never happen in a built binary.",
|
||||||
|
"Error:", err,
|
||||||
|
)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
exeDir := filepath.Dir(exe)
|
||||||
|
assets := filepath.Join(exeDir, "assets")
|
||||||
|
|
||||||
|
if _, err := os.Stat(assets); err != nil {
|
||||||
|
log.Println(
|
||||||
|
"[ASSETS][ERROR] Assets directory not found next to binary.",
|
||||||
|
"This error ONLY occurs when the application is running from a built binary.",
|
||||||
|
"Expected path:", assets,
|
||||||
|
"Executable path:", exe,
|
||||||
|
)
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println(
|
||||||
|
"[ASSETS][OK] Static assets enabled.",
|
||||||
|
"Mode: production (binary execution).",
|
||||||
|
"Assets path:", assets,
|
||||||
|
)
|
||||||
|
|
||||||
|
return assets
|
||||||
|
}
|
||||||
@@ -65,6 +65,7 @@ import (
|
|||||||
hk "github.com/karincake/hongkue"
|
hk "github.com/karincake/hongkue"
|
||||||
|
|
||||||
/******************** infra ********************/
|
/******************** infra ********************/
|
||||||
|
assets "simrs-vx/internal/infra/assets"
|
||||||
ibpjs "simrs-vx/internal/infra/bpjs"
|
ibpjs "simrs-vx/internal/infra/bpjs"
|
||||||
docscfg "simrs-vx/internal/infra/docs-cfg"
|
docscfg "simrs-vx/internal/infra/docs-cfg"
|
||||||
gs "simrs-vx/internal/infra/gorm-setting"
|
gs "simrs-vx/internal/infra/gorm-setting"
|
||||||
@@ -161,6 +162,12 @@ func SetRoutes() http.Handler {
|
|||||||
|
|
||||||
r := http.NewServeMux()
|
r := http.NewServeMux()
|
||||||
|
|
||||||
|
r.Handle("/assets/",
|
||||||
|
http.StripPrefix("/assets/",
|
||||||
|
http.FileServer(http.Dir(assets.GetAssetsDir())),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
/******************** Main ********************/
|
/******************** Main ********************/
|
||||||
r.HandleFunc("/", home.Home)
|
r.HandleFunc("/", home.Home)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user