Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haochi/koala
Lightweight router/multiplexer for Go
https://github.com/haochi/koala
Last synced: about 9 hours ago
JSON representation
Lightweight router/multiplexer for Go
- Host: GitHub
- URL: https://github.com/haochi/koala
- Owner: haochi
- License: mit
- Created: 2016-01-15T08:00:48.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-17T09:10:15.000Z (almost 9 years ago)
- Last Synced: 2024-06-20T00:43:18.783Z (5 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# koala [![Build Status](https://travis-ci.org/haochi/koala.svg?branch=master)](https://travis-ci.org/haochi/koala) [![GoDoc](https://godoc.org/github.com/haochi/koala?status.svg)](https://godoc.org/github.com/haochi/koala)
lightweight multiplexer for Go
## install
```bash
$ go get "github.com/haochi/koala"
``````go
package mainimport (
"github.com/haochi/koala"
"net/http"
"fmt"
)func main() {
app := koala.New()app.Get("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, World!")
})app.Get("/~{id}", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "user %s reporting for duty!", koala.Param(r, "id"))
})panic(http.ListenAndServe(":8080", app))
}```