Guest User

go

a guest
Dec 16th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.30 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "log"
  5.     "fmt"
  6.     "github.com/valyala/fasthttp"
  7. )
  8.  
  9. func main() {
  10.     err := fasthttp.ListenAndServe("127.0.0.1:12345", handler); if err != nil {
  11.         log.Fatalf("Error in ListenAndServe: %s", err)
  12.     }
  13. }
  14.  
  15. func handler(ctx *fasthttp.RequestCtx) {
  16.     fmt.Fprintf(ctx, "HelloWorld")
  17. }
Add Comment
Please, Sign In to add comment