Compare commits
1 Commits
01073aca78
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| dd778174a7 |
@@ -29,9 +29,6 @@ type Config struct {
|
|||||||
DBURL string
|
DBURL string
|
||||||
Debug bool
|
Debug bool
|
||||||
MaintenanceMode bool
|
MaintenanceMode bool
|
||||||
DevelopmentMode bool
|
|
||||||
DevAdminUsername string
|
|
||||||
DevAdminPassword string
|
|
||||||
MetricsPassword string
|
MetricsPassword string
|
||||||
MetricsUsername string
|
MetricsUsername string
|
||||||
Port int
|
Port int
|
||||||
@@ -55,9 +52,6 @@ func New(lc fx.Lifecycle, params ConfigParams) (*Config, error) {
|
|||||||
|
|
||||||
viper.SetDefault("DEBUG", "false")
|
viper.SetDefault("DEBUG", "false")
|
||||||
viper.SetDefault("MAINTENANCE_MODE", "false")
|
viper.SetDefault("MAINTENANCE_MODE", "false")
|
||||||
viper.SetDefault("DEVELOPMENT_MODE", "false")
|
|
||||||
viper.SetDefault("DEV_ADMIN_USERNAME", "")
|
|
||||||
viper.SetDefault("DEV_ADMIN_PASSWORD", "")
|
|
||||||
viper.SetDefault("PORT", "8080")
|
viper.SetDefault("PORT", "8080")
|
||||||
viper.SetDefault("DBURL", "")
|
viper.SetDefault("DBURL", "")
|
||||||
viper.SetDefault("SENTRY_DSN", "")
|
viper.SetDefault("SENTRY_DSN", "")
|
||||||
@@ -81,9 +75,6 @@ func New(lc fx.Lifecycle, params ConfigParams) (*Config, error) {
|
|||||||
Port: viper.GetInt("PORT"),
|
Port: viper.GetInt("PORT"),
|
||||||
SentryDSN: viper.GetString("SENTRY_DSN"),
|
SentryDSN: viper.GetString("SENTRY_DSN"),
|
||||||
MaintenanceMode: viper.GetBool("MAINTENANCE_MODE"),
|
MaintenanceMode: viper.GetBool("MAINTENANCE_MODE"),
|
||||||
DevelopmentMode: viper.GetBool("DEVELOPMENT_MODE"),
|
|
||||||
DevAdminUsername: viper.GetString("DEV_ADMIN_USERNAME"),
|
|
||||||
DevAdminPassword: viper.GetString("DEV_ADMIN_PASSWORD"),
|
|
||||||
MetricsUsername: viper.GetString("METRICS_USERNAME"),
|
MetricsUsername: viper.GetString("METRICS_USERNAME"),
|
||||||
MetricsPassword: viper.GetString("METRICS_PASSWORD"),
|
MetricsPassword: viper.GetString("METRICS_PASSWORD"),
|
||||||
log: log,
|
log: log,
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
package handlers
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"git.eeqj.de/sneak/gohttpserver/templates"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (s *Handlers) HandleSignupGET() http.HandlerFunc {
|
|
||||||
t := templates.GetParsed()
|
|
||||||
|
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
|
||||||
err := t.ExecuteTemplate(w, "signup.html", nil)
|
|
||||||
if err != nil {
|
|
||||||
s.log.Error().Err(err).Msg("")
|
|
||||||
http.Error(w, http.StatusText(500), 500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *Handlers) HandleSignupPOST() http.HandlerFunc {
|
|
||||||
t := templates.GetParsed()
|
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
|
||||||
|
|
||||||
_ = r.ParseForm()
|
|
||||||
|
|
||||||
err := t.ExecuteTemplate(w, "signup.html", nil)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
s.log.Error().Err(err).Msg("")
|
|
||||||
http.Error(w, http.StatusText(500), 500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -41,6 +41,7 @@ type ServerParams struct {
|
|||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
startupTime time.Time
|
startupTime time.Time
|
||||||
|
port int
|
||||||
exitCode int
|
exitCode int
|
||||||
sentryEnabled bool
|
sentryEnabled bool
|
||||||
log *zerolog.Logger
|
log *zerolog.Logger
|
||||||
|
|||||||
Reference in New Issue
Block a user