/rewrite

URL rewriting for Golang

Primary LanguageGoMIT LicenseMIT

Build Status Badge Go Docs Badge

Rewrite

Golang URL rewriting

Usage

import "github.com/haoxins/rewrite"

// ...

handler := rewrite.NewHandler(map[string]string{
  "/a": "/b",
  "/api/(.*)", "/api/v1/$1",
  "/api/(.*)/actions/(.*)", "/api/v1/$1/actions/$2",
  "/from/:one/to/:two", "/from/:two/to/:one",
})

// ...