Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haoxins/rewrite
URL rewriting for Golang
https://github.com/haoxins/rewrite
go golang http-url rewriting url
Last synced: 20 days ago
JSON representation
URL rewriting for Golang
- Host: GitHub
- URL: https://github.com/haoxins/rewrite
- Owner: haoxins
- License: mit
- Created: 2015-12-14T14:48:41.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2022-03-26T15:29:26.000Z (over 2 years ago)
- Last Synced: 2024-10-05T00:59:28.689Z (about 1 month ago)
- Topics: go, golang, http-url, rewriting, url
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 31
- Watchers: 4
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status Badge]][Build Status]
[![Go Docs Badge]][Go Docs]### Rewrite
Golang URL rewriting
### Usage
```go
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",
})// ...
```[Build Status Badge]: https://github.com/haoxins/rewrite/actions/workflows/test.yaml/badge.svg
[Build Status]: https://github.com/haoxins/rewrite/actions/workflows/test.yaml
[Go Docs Badge]: https://pkg.go.dev/badge/github.com/haoxins/rewrite
[Go Docs]: https://pkg.go.dev/github.com/haoxins/rewrite