Skip to content

E0707: A folder route and a hand-written route share a path ​

A page under pages/ and a route registered by hand — a web.Routes call, an app.Get — answer the same method and path, so one would shadow the other. Reported at both: the page and the hand-written call.

Wrong ​

go
// main.go, with pages/employers/index.go serving GET /employers
func init() {
	web.Routes.Get("/employers", ListEmployers)
}
go
// The page serves GET /employers; the JSON list goes elsewhere.
func init() {
	web.Routes.Get("/api/employers", ListEmployers)
}

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.