6555a68fa9
Serve the front-end sources of the new back-office through the current satellite admin server under the path `/back-office`. The front-end is served in the same way than the current one, which is through an indicated directory path with a configuration parameter or embed in the binary when that configuration parameter is empty. The commit also slightly changes the test that checks serving these static assets for not targeting the empty file in the build folder. build folders must remain because of the embed directive. Change-Id: I3c5af6b75ec944722dbdc4c560d0e7d907a205b8
26 lines
451 B
Go
26 lines
451 B
Go
// Copyright (C) 2023 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
//go:build !noembed
|
|
// +build !noembed
|
|
|
|
package backofficeui
|
|
|
|
import (
|
|
"embed"
|
|
"fmt"
|
|
"io/fs"
|
|
)
|
|
|
|
//go:embed all:build/*
|
|
var assets embed.FS
|
|
|
|
// Assets contains either the built admin/back-office/ui or it is empty.
|
|
var Assets = func() fs.FS {
|
|
build, err := fs.Sub(assets, "build")
|
|
if err != nil {
|
|
panic(fmt.Errorf("invalid embedding: %w", err))
|
|
}
|
|
return build
|
|
}()
|