Rename module path github.com/ryanhamamura/c4 to github.com/ryanhamamura/games across go.mod, all source files, and golangci config.
27 lines
759 B
Go
27 lines
759 B
Go
// Package lobby handles the game lobby page, game creation, and navigation.
|
|
package lobby
|
|
|
|
import (
|
|
"github.com/ryanhamamura/games/connect4"
|
|
"github.com/ryanhamamura/games/db/repository"
|
|
"github.com/ryanhamamura/games/snake"
|
|
|
|
"github.com/alexedwards/scs/v2"
|
|
"github.com/go-chi/chi/v5"
|
|
)
|
|
|
|
func SetupRoutes(
|
|
router chi.Router,
|
|
queries *repository.Queries,
|
|
sessions *scs.SessionManager,
|
|
store *connect4.Store,
|
|
snakeStore *snake.SnakeStore,
|
|
) {
|
|
router.Get("/", HandleLobbyPage(queries, sessions, snakeStore))
|
|
|
|
router.Post("/games", HandleCreateGame(store, sessions))
|
|
router.Delete("/games/{id}", HandleDeleteGame(store, sessions))
|
|
router.Post("/snake", HandleCreateSnakeGame(snakeStore, sessions))
|
|
router.Post("/logout", HandleLogout(sessions))
|
|
}
|