fix: conditional client build
This commit is contained in:
17
server/internal/handlers/client/client.go
Normal file
17
server/internal/handlers/client/client.go
Normal file
@ -0,0 +1,17 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/spotdemo4/trevstack/server/internal/interceptors"
|
||||
)
|
||||
|
||||
var embedfs *http.FileSystem
|
||||
|
||||
func NewClientHandler(key string) http.Handler {
|
||||
if embedfs != nil {
|
||||
return interceptors.WithAuthRedirect(http.FileServer(*embedfs), key)
|
||||
}
|
||||
|
||||
return http.NotFoundHandler()
|
||||
}
|
Reference in New Issue
Block a user