top

Package content contains routines for delivering content to the client.

phi is a small, idiomatic and composable router for building HTTP services.

phi requires Go 1.7 or newer.

Example:

package main

import (
	"net/http"

	phi "maze.io/phi.v1"
	"maze.io/phi.v1/middleware"
)

func main() {
	r := phi.NewRouter()
	r.Use(middleware.Logger)
	r.Use(middleware.Recoverer)

	r.Get("/", func(ctx *phi.Context) {
		ctx.Write([]byte("root."))
	})

	http.ListenAndServe(":3333", r)
}

See maze.io/phi/_examples/ for more in-depth examples.

Imports 2 package(s) ΒΆ

  1. golang.org/x/net/context
  2. maze.io/phi.v1/header