first round of files
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>ForgeBucket</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<p style="font-family:sans-serif;padding:2rem">
|
||||
Frontend not built yet — run <code>make build</code> or <code>make dev</code>.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:embed all:dist
|
||||
var staticFiles embed.FS
|
||||
|
||||
// FS returns the embedded frontend/dist subtree.
|
||||
// Falls back to an empty FS during development (before `make build` runs).
|
||||
func FS() fs.FS {
|
||||
sub, err := fs.Sub(staticFiles, "dist")
|
||||
if err != nil {
|
||||
return http.FS(http.Dir(""))
|
||||
}
|
||||
return sub
|
||||
}
|
||||
Reference in New Issue
Block a user