feed.go 440 B

12345678910111213141516171819202122
  1. package router
  2. import "github.com/gorilla/mux"
  3. // constant names for the named routes
  4. const (
  5. FeedOverview = "Feed:overview"
  6. FeedPost = "Feed:post"
  7. )
  8. // FeedApp constructs a mux.Router containing the routes for Feed html app
  9. func FeedApp(m *mux.Router) *mux.Router {
  10. if m == nil {
  11. m = mux.NewRouter()
  12. }
  13. m.Path("/").Methods("GET").Name(FeedOverview)
  14. m.Path("/post/{PostID:[0-9]+}").Methods("GET").Name(FeedPost)
  15. return m
  16. }