I want to make my app to serve below things.
I made a code like below:
package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.Static("/", "/www")
apiv1 := r.Group("api/v1")
{
apiv1.GET("/disk", diskSpaceHandler)
apiv1.GET("/memory", memoryHandler)
apiv1.GET("/cpu", cpuHandler)
}
r.Run(":80")
}
When I run the code, it panics:
panic: path segment '/api/v1/disk' conflicts with existing wildcard '/*filepath' in path '/api/v1/disk'
I understand why it panics, but I have no idea how to fix.
Just two things comes up in my mind:
Thank you in advance.