Cleanup
This commit is contained in:
parent
c6893a1679
commit
5594b20e8d
@ -33,7 +33,7 @@
|
|||||||
"images/characters/arn-waifu.png"
|
"images/characters/arn-waifu.png"
|
||||||
],
|
],
|
||||||
"manifest": {
|
"manifest": {
|
||||||
"theme_color": "rgb(248, 165, 130)",
|
"theme_color": "#f8a582",
|
||||||
"gcm_sender_id": "941298467524"
|
"gcm_sender_id": "941298467524"
|
||||||
},
|
},
|
||||||
"ports": {
|
"ports": {
|
||||||
|
BIN
images/icons/favicon.ico
Normal file
BIN
images/icons/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
20
logger.go
Normal file
20
logger.go
Normal file
@ -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)
|
19
main.go
19
main.go
@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
"github.com/aerogo/aero"
|
"github.com/aerogo/aero"
|
||||||
@ -52,10 +51,15 @@ func main() {
|
|||||||
return ctx.JSON(app.Config.Manifest)
|
return ctx.JSON(app.Config.Manifest)
|
||||||
})
|
})
|
||||||
|
|
||||||
app.Get("/ip", func(ctx *aero.Context) string {
|
app.Get("/favicon.ico", func(ctx *aero.Context) string {
|
||||||
ip := ctx.RealIP()
|
ctx.SetHeader("Content-Type", "image/x-icon")
|
||||||
fmt.Println(ip)
|
data, _ := ioutil.ReadFile("images/icons/favicon.ico")
|
||||||
return ctx.Text(ip)
|
return string(data)
|
||||||
|
})
|
||||||
|
|
||||||
|
// For benchmarks
|
||||||
|
app.Get("/hello", func(ctx *aero.Context) string {
|
||||||
|
return ctx.Text("Hello World")
|
||||||
})
|
})
|
||||||
|
|
||||||
// Scripts
|
// Scripts
|
||||||
@ -67,11 +71,6 @@ func main() {
|
|||||||
return js
|
return js
|
||||||
})
|
})
|
||||||
|
|
||||||
// For testing
|
|
||||||
app.Get("/hello", func(ctx *aero.Context) string {
|
|
||||||
return ctx.Text("Hello World")
|
|
||||||
})
|
|
||||||
|
|
||||||
// Let's go
|
// Let's go
|
||||||
app.Run()
|
app.Run()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user