Skip to content

Instantly share code, notes, and snippets.

@aisk
Created April 1, 2017 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aisk/f9d660b24b8cccee656d26a763c856cd to your computer and use it in GitHub Desktop.
Save aisk/f9d660b24b8cccee656d26a763c856cd to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
"github.com/aisk/vox"
)
func timeit(ctx *vox.Context, next func()) {
t := time.Now()
next()
fmt.Println("time usage:", time.Now().Sub(t))
}
func main() {
app := vox.New()
app.Use(func(ctx *vox.Context, next func()) {
ctx.Response.Body = "我艹"
ctx.Response.Status = 201
ctx.Response.Headers.Set("fuck", "ya!")
})
app.Run(":3000")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment