mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2026-06-21 08:18:08 +02:00
Add simple auth (#186)
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/SecurityBrewery/catalyst"
|
||||
"github.com/SecurityBrewery/catalyst/cmd"
|
||||
"github.com/SecurityBrewery/catalyst/generated/api"
|
||||
"github.com/SecurityBrewery/catalyst/hooks"
|
||||
"github.com/SecurityBrewery/catalyst/ui"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -22,7 +26,10 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if err := http.ListenAndServe(":8000", theCatalyst.Server); err != nil {
|
||||
fsys, _ := fs.Sub(ui.UI, "dist")
|
||||
theCatalyst.Server.Get("/ui/*", api.Static(fsys))
|
||||
|
||||
if err := http.ListenAndServe(fmt.Sprintf(":%d", config.Port), theCatalyst.Server); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user