https://github.com/l1ttps/routix
🚀 Routing X is a Golang library for routing REST APIs 🚀
https://github.com/l1ttps/routix
gin-gonic golang routing
Last synced: 9 months ago
JSON representation
🚀 Routing X is a Golang library for routing REST APIs 🚀
- Host: GitHub
- URL: https://github.com/l1ttps/routix
- Owner: l1ttps
- License: mit
- Created: 2023-10-31T04:12:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T08:46:41.000Z (about 2 years ago)
- Last Synced: 2025-03-13T17:01:52.223Z (9 months ago)
- Topics: gin-gonic, golang, routing
- Language: Go
- Homepage: https://pkg.go.dev/github.com/l1ttps/routix
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RoutiX
🚀 Routing X is a Golang library for routing REST APIs 🚀
# Features
- Build for [Gin gonic](https://github.com/gin-gonic/gin)
- Auto grouping routers on instance gin engine
- Auto apply middlewares for global
- Just return any data type from the handler function without using additional functions
- Return HTTP exception filter as JSON status code and message
- Guard
- Interceptor
# Installation
```
go get github.com/l1ttps/routix
go get github.com/gin-gonic/gin
```
# Example of usage
1. Create a file app_controler.go
```go
package controller
import (
"github.com/gin-gonic/gin"
"github.com/l1ttps/routix"
)
var (
Controller = routix.Controller
Get = routix.Get
)
func AppController() *gin.Engine {
return Controller("/",
Get("/",
func(c *gin.Context) interface{} {
return "hello world"
},
),
)
}
```
2. Create a file main.go
```go
package main
import (
"github.com/l1ttps/routix"
"/controller"
)
var (
CreateServer = routix.CreateServer
)
func main() {
CreateServer(routix.ServerConfig{
Controllers: []routix.ControllerType{
controller.AppController,
},
DebugLogger: true,
}).Run(":3000")
}
```
3. Run go run main.go and open http://localhost:3000