Jobs & Workflows https://armen.surge.sh
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB

/*
------------------------------------------------------------------------------------------------------------------------
####### gui ####### Copyright (c) 2021 mls-361 ##################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package gui
import (
"net/http"
"forge.chapril.org/armen/armen/internal/components"
)
func Build(ccs *components.Components) error {
staticFS, err := getStaticFS()
if err != nil {
return err
}
router := ccs.Router
router.ServeFiles("/static/*filepath", staticFS)
router.Get("/", http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_ = newDashboard(ccs).
build().
Render(w)
}))
router.Get("/dashboard", http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_ = newDashboard(ccs).
build().
Render(w)
}))
return nil
}
/*
######################################################################################################## @(°_°)@ #######
*/