profile.go 450 B

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