Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (21 sloc) 474 Bytes
package main
import (
"net"
"github.com/kataras/iris"
)
func main() {
app := iris.New()
app.Get("/", func(ctx iris.Context) {
ctx.Writef("Hello from the server")
})
app.Get("/mypath", func(ctx iris.Context) {
ctx.Writef("Hello from %s", ctx.Path())
})
// create any custom tcp listener, unix sock file or tls tcp listener.
l, err := net.Listen("tcp4", ":8080")
if err != nil {
panic(err)
}
// use of the custom listener
app.Run(iris.Listener(l))
}