1
0
Fork 0
forked from goffee/core

theme base system

This commit is contained in:
Zeni Kim 2024-09-27 02:27:24 -05:00
parent 1172e23c16
commit 465e88bf40
7 changed files with 74 additions and 51 deletions

11
core.go
View file

@ -39,7 +39,7 @@ var basePath string
var disableEvents bool = false
//go:embed all:template
var resources embed.FS
var components_resources embed.FS
type configContainer struct {
Request RequestConfig
@ -79,6 +79,10 @@ func (app *App) Bootstrap() {
NewEventsManager()
}
func (app *App) RegisterTemplates(templates_resources embed.FS) {
NewTemplates(components_resources, templates_resources)
}
func (app *App) Run(router *httprouter.Router) {
portNumber := os.Getenv("App_HTTP_PORT")
if portNumber == "" {
@ -97,11 +101,6 @@ func (app *App) Run(router *httprouter.Router) {
// add public path
publicPath := os.Getenv("TEMPLATE_PUBLIC")
router.ServeFiles("/public/*filepath", http.Dir(publicPath))
// templates
var template = new(Template)
template.NewTemplates(resources)
}
useHttpsStr := os.Getenv("App_USE_HTTPS")