Minor changes

This commit is contained in:
Eduard Urbach 2016-10-24 00:48:15 +09:00
parent 6b3a670acb
commit 6805afaa61

17
main.go
View File

@ -8,15 +8,6 @@ import (
"github.com/blitzprog/arn" "github.com/blitzprog/arn"
) )
const (
gzipThreshold = 1450
contentTypeHeader = "content-type"
contentType = "text/html;charset=utf-8"
contentEncodingHeader = "content-encoding"
contentEncoding = "gzip"
hello = "Hello World"
)
func main() { func main() {
app := aero.New() app := aero.New()
@ -26,11 +17,11 @@ func main() {
ctx.RespondBytes(example) ctx.RespondBytes(example)
}) })
template := aero.NewTemplate("pages/anime/anime.pug") app.Get("/hello", func(ctx *aero.Context) {
ctx.Respond("Hello World")
})
// app.Get("/hello", func(ctx *fasthttp.RequestCtx, _ fasthttprouter.Params) { template := aero.NewTemplate("pages/anime/anime.pug")
// aero.Respond(ctx, "Hello World")
// })
app.Get("/anime/:id", func(ctx *aero.Context) { app.Get("/anime/:id", func(ctx *aero.Context) {
id, _ := strconv.Atoi(ctx.Params.ByName("id")) id, _ := strconv.Atoi(ctx.Params.ByName("id"))