https://github.com/ngamux/ngamux
Simple HTTP router for Go
https://github.com/ngamux/ngamux
go hacktoberfest http
Last synced: 6 months 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 (11 months ago)
- Last Synced: 2024-08-03T19:10:02.061Z (9 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[](http://golang.org)
[](https://github.com/ngamux/ngamux)
[](https://pkg.go.dev/github.com/ngamux/ngamux)
[](https://goreportcard.com/report/github.com/ngamux/ngamux)
[](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](https://github.com/ngamux/ngamux/graphs/contributors)