- Integrated a React-based web frontend into the Go server using the `embed` package, serving it from `/`. - Added build and development scripts utilizing Bun for the React app (`package.json`, `README.md`). - Enhanced auth interface to support better user experience and permissions (`App.jsx`, CSS updates). - Refactored `/api/auth/login` to serve React UI, removing hardcoded HTML template. - Implemented `/api/permissions/` with ACL support for user access management.
19 lines
363 B
Go
19 lines
363 B
Go
package app
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed web/dist
|
|
var reactAppFS embed.FS
|
|
|
|
// GetReactAppFS returns a http.FileSystem from the embedded React app
|
|
func GetReactAppFS() http.FileSystem {
|
|
webDist, err := fs.Sub(reactAppFS, "web/dist")
|
|
if err != nil {
|
|
panic("Failed to load embedded web app: " + err.Error())
|
|
}
|
|
return http.FS(webDist)
|
|
} |