Created
February 26, 2020 13:12
-
-
Save bastianccm/c5841e480568b6d805b034afbb9bedf1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package polls | |
import "flamingo.me/flamingo/v3/framework/web" | |
type urls struct { | |
controller *controller | |
} | |
func (u *urls) Inject(controller *controller) { | |
u.controller = controller | |
} | |
func (u *urls) Routes(registry *web.RouterRegistry) { | |
registry.MustRoute("/", "index") | |
registry.HandleAny("index", u.controller.index) | |
registry.MustRoute("/:question_id", "detail") | |
registry.HandleAny("detail", u.controller.detail) | |
registry.MustRoute("/:question_id/results", "results") | |
registry.HandleAny("results", u.controller.results) | |
registry.MustRoute("/:question_id/vote", "vote") | |
registry.HandleAny("vote", u.controller.vote) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment