diff --git a/config.json b/config.json index e0a41926..48fd8390 100644 --- a/config.json +++ b/config.json @@ -33,7 +33,7 @@ "images/characters/arn-waifu.png" ], "manifest": { - "theme_color": "rgb(248, 165, 130)", + "theme_color": "#f8a582", "gcm_sender_id": "941298467524" }, "ports": { diff --git a/images/icons/favicon.ico b/images/icons/favicon.ico new file mode 100644 index 00000000..4d6a4cde Binary files /dev/null and b/images/icons/favicon.ico differ diff --git a/logger.go b/logger.go new file mode 100644 index 00000000..675f7d06 --- /dev/null +++ b/logger.go @@ -0,0 +1,20 @@ +package main + +// loggerConfig := zap.NewDevelopmentConfig() +// loggerConfig.OutputPaths = append(loggerConfig.OutputPaths, "logs/server.log") + +// logger, _ := loggerConfig.Build() + +// logTime := func(ctx *aero.Context, next func()) { +// start := time.Now() +// next() +// responseTime := time.Since(start) + +// if ctx.StatusCode == 200 { +// logger.Info(ctx.URI(), zap.Duration("responseTime", responseTime), zap.Int("statusCode", ctx.StatusCode)) +// } else { +// logger.Warn(ctx.URI(), zap.Duration("responseTime", responseTime), zap.Int("statusCode", ctx.StatusCode)) +// } +// } + +// app.Use(logTime) diff --git a/main.go b/main.go index d0e42778..b886bb7d 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "io/ioutil" "github.com/aerogo/aero" @@ -52,10 +51,15 @@ func main() { return ctx.JSON(app.Config.Manifest) }) - app.Get("/ip", func(ctx *aero.Context) string { - ip := ctx.RealIP() - fmt.Println(ip) - return ctx.Text(ip) + app.Get("/favicon.ico", func(ctx *aero.Context) string { + ctx.SetHeader("Content-Type", "image/x-icon") + data, _ := ioutil.ReadFile("images/icons/favicon.ico") + return string(data) + }) + + // For benchmarks + app.Get("/hello", func(ctx *aero.Context) string { + return ctx.Text("Hello World") }) // Scripts @@ -67,11 +71,6 @@ func main() { return js }) - // For testing - app.Get("/hello", func(ctx *aero.Context) string { - return ctx.Text("Hello World") - }) - // Let's go app.Run() }