-
-
Save aisk/f9d660b24b8cccee656d26a763c856cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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