feature: add debug mode in configuration
- automatically reload HTML templates when debug mode is activated (no rebuild necessary)
This commit is contained in:
parent
c266bfa14b
commit
5c5a51f9b1
|
@ -68,6 +68,7 @@ func getServiceContainer(conf *config.Config) (*service.Container, error) {
|
||||||
// Create and expose template service provider
|
// Create and expose template service provider
|
||||||
ctn.Provide(template.ServiceName, html.ServiceProvider(
|
ctn.Provide(template.ServiceName, html.ServiceProvider(
|
||||||
html.NewDirectoryLoader(conf.HTTP.TemplateDir),
|
html.NewDirectoryLoader(conf.HTTP.TemplateDir),
|
||||||
|
html.WithDevMode(conf.Debug),
|
||||||
))
|
))
|
||||||
|
|
||||||
// Create and expose config service provider
|
// Create and expose config service provider
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
Debug bool `yaml:"debug"`
|
||||||
HTTP HTTPConfig `yaml:"http"`
|
HTTP HTTPConfig `yaml:"http"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +47,7 @@ func NewDumpDefault() *Config {
|
||||||
|
|
||||||
func NewDefault() *Config {
|
func NewDefault() *Config {
|
||||||
return &Config{
|
return &Config{
|
||||||
|
Debug: false,
|
||||||
HTTP: HTTPConfig{
|
HTTP: HTTPConfig{
|
||||||
Address: ":3000",
|
Address: ":3000",
|
||||||
CookieAuthenticationKey: "",
|
CookieAuthenticationKey: "",
|
||||||
|
|
Loading…
Reference in New Issue