Skip to content

Root static resource router not supported #2537

@oyoungs

Description

@oyoungs

After I registered other routers, when I want to register the static resources router to the path "/", it told me "CONFLICTS"

My code:

func main() {
        router := gin.Default()

	router.Use(gin.Logger())

	router.Use(gin.Recovery())

	router.StaticFS("/", http.Dir("public"))

	v1 := router.Group("/api/v1")

	{
		task := v1.Group("/task")

		api.NewTaskApi(task)

	}

	router.Run(":3408")
}

errors like that:

panic: '/api/v1/task/' in new path '/api/v1/task/' conflicts with existing wildcard '/*filepath' in existing prefix '/*filepath'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions