Skip to content

Commit

Permalink
fix: room numbers must be numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresalice committed May 17, 2021
1 parent 9a6b06e commit 795fbcf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.go
Expand Up @@ -64,11 +64,11 @@ func main() {
router := mux.NewRouter()
router.StrictSlash(true)
router.HandleFunc("/", rootHandler).Methods("GET")
router.HandleFunc("/{room}", roomHandler).Methods("GET")
router.HandleFunc("/{room}/mood", addMoodHandler).Methods("POST")
router.HandleFunc("/{room}/ws", wsHandler)
router.HandleFunc("/{room}/all", allHandler).Methods("GET")
router.HandleFunc("/{room}/delete", deleteMoodHandler).Methods("POST")
router.HandleFunc("/{room:[0-9]+}", roomHandler).Methods("GET")
router.HandleFunc("/{room:[0-9]+}/mood", addMoodHandler).Methods("POST")
router.HandleFunc("/{room:[0-9]+}/ws", wsHandler)
router.HandleFunc("/{room:[0-9]+}/all", allHandler).Methods("GET")
router.HandleFunc("/{room:[0-9]+}/delete", deleteMoodHandler).Methods("POST")
go echo()

log.Printf("Now open http://localhost:%s", app.Port)
Expand Down

0 comments on commit 795fbcf

Please sign in to comment.