Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngamux/ngamux
Simple HTTP router for Go
https://github.com/ngamux/ngamux
go hacktoberfest http
Last synced: about 1 month ago
JSON representation
Simple HTTP router for Go
- Host: GitHub
- URL: https://github.com/ngamux/ngamux
- Owner: ngamux
- License: mpl-2.0
- Created: 2021-08-22T08:31:40.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-04T11:20:13.000Z (7 months ago)
- Last Synced: 2024-08-03T19:10:02.061Z (5 months ago)
- Topics: go, hacktoberfest, http
- Language: Go
- Homepage:
- Size: 129 KB
- Stars: 65
- Watchers: 2
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go-extra - ngamux - 08-22T08:31:40Z|2022-03-26T11:56:20Z| (Web Frameworks / Routers)
README
# ngamux
Simple HTTP router for Go[![made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](http://golang.org)
[![Go Version](https://img.shields.io/github/go-mod/go-version/ngamux/ngamux.svg)](https://github.com/ngamux/ngamux)
[![GoDoc Reference](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/ngamux/ngamux)
[![GoReportCard](https://goreportcard.com/badge/github.com/ngamux/ngamux)](https://goreportcard.com/report/github.com/ngamux/ngamux)
[![Coverage Status](https://codecov.io/gh/ngamux/ngamux/branch/master/graph/badge.svg?token=7ORUPOWS3I)](https://codecov.io/gh/ngamux/ngamux)
---* [Installation](#installation)
* [Examples](#examples)
* [Provided Middlewares](#provided-middlewares)
* [License](#license)---
# Installation
Run this command with correctly configured Go toolchain.
```bash
go get github.com/ngamux/ngamux
```# Examples
```go
package mainimport(
"net/http"
"github.com/ngamux/ngamux"
)func main() {
mux := ngamux.New()
mux.Get("/", func(rw http.ResponseWriter, r *http.Request) error {
return ngamux.Res(rw).
Status(http.StatusOK).
Json(ngamux.Map{
"message": "welcome!",
})
})
http.ListenAndServe(":8080", mux)
}
```See more [examples](https://github.com/ngamux/ngamux-example)!
# Provided Middlewares
* [CORS](https://github.com/ngamux/middleware/tree/master/cors)
* [Recover](https://github.com/ngamux/middleware/tree/master/recover)
* [File Upload](https://github.com/ngamux/middleware/tree/master/fileupload)
* [Log](https://github.com/ngamux/middleware/tree/master/log)
* [Auth JWT](https://github.com/ngamux/middleware/tree/master/authjwt)
* [No Cache](https://github.com/ngamux/middleware/tree/master/nocache)
* [Ping](https://github.com/ngamux/middleware/tree/master/ping)
* [Redirect](https://github.com/ngamux/middleware/tree/master/redirect)# License
This project is licensed under the [Mozilla Public License 2.0](https://github.com/ngamux/ngamux/blob/master/LICENSE).# Contributors
Thanks to all contributors![![Contributors](https://contrib.rocks/image?repo=ngamux/ngamux)](https://github.com/ngamux/ngamux/graphs/contributors)