leo
f129606b8f
All checks were successful
continuous-integration/drone/push Build is passing
* add handlers for signin,singup,logout... * introduce ent ORM and add user schema * add live mode, devel mode to selectively turn on features via config/flags * add templates, handle embedding moar smarter: * live mode uses live folder structure, else embedded templates are used * start using tailwindcss to style stuff * add development goodies for hot-reloading (browser-sync - bs.js) * pimp-up config.dhall with actual custom config Type (enables remote schema and local values only as needed) * add justfile (alternative to makefile for process automation)
40 lines
635 B
Go
40 lines
635 B
Go
package handlers
|
|
|
|
import (
|
|
"io/fs"
|
|
"log"
|
|
|
|
"git.dotya.ml/mirre-mt/pcmt/config"
|
|
)
|
|
|
|
var (
|
|
conf *config.Config
|
|
appver string
|
|
)
|
|
|
|
func setConfig(c *config.Config) {
|
|
if c != nil {
|
|
log.Printf("setting handler config to %#v", conf)
|
|
// c = conf
|
|
log.Printf("set handler config to %#v", c)
|
|
conf = c
|
|
} else {
|
|
log.Println("error passing conf to handlers")
|
|
}
|
|
}
|
|
|
|
func getConfig() *config.Config {
|
|
return conf
|
|
}
|
|
|
|
func setAppVer(v string) {
|
|
log.Printf("handlers version: %s", v)
|
|
appver = v
|
|
}
|
|
|
|
func InitHandlers(version string, appconf *config.Config, tmpls fs.FS) {
|
|
setConfig(appconf)
|
|
setAppVer(version)
|
|
initTemplates(tmpls)
|
|
}
|