> For the complete documentation index, see [llms.txt](https://yingshaoxo.gitbook.io/go-tutorial-for-pythoner/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yingshaoxo.gitbook.io/go-tutorial-for-pythoner/web-server/a-simple-webserver.md).

# A simple webserver

```
package main

import ("fmt"
        "net/http")

func index_handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hello, yingshaoxo!")
}

func about_handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "This is based on Golang.")
}

func main() {
    http.HandleFunc("/", index_handler)
    http.HandleFunc("/about/", about_handler)

    fmt.Println("http://127.0.0.1:5000")
    http.ListenAndServe(":5000", nil)
}
```

It's much like python's flask package:

`/` for index of website.

`/about/` for about page.

There just one thing you should care about: `*`.

It reads value from a pointer address (`http.Request`).
