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.
38 lines
991 B
38 lines
991 B
/* |
|
------------------------------------------------------------------------------------------------------------------------ |
|
####### gui ####### Copyright (c) 2021 mls-361 ##################################################### MIT License ####### |
|
------------------------------------------------------------------------------------------------------------------------ |
|
*/ |
|
|
|
package gui |
|
|
|
import ( |
|
"net/http" |
|
|
|
"forge.chapril.org/armen/armen/internal/components" |
|
) |
|
|
|
type gui struct { |
|
storage components.Storage |
|
} |
|
|
|
func newGUI(ccs *components.Components) *gui { |
|
return &gui{ |
|
storage: ccs.Storage, |
|
} |
|
} |
|
|
|
func Build(ccs *components.Components) { |
|
gui := newGUI(ccs) |
|
router := ccs.Router |
|
|
|
router.Get("/", http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { |
|
_ = gui.Home().Render(w) |
|
})) |
|
|
|
router.ServeFiles("/static/*filepath", http.Dir("static")) |
|
} |
|
|
|
/* |
|
######################################################################################################## @(°_°)@ ####### |
|
*/
|
|
|