initial commit
This commit is contained in:
parent
9baa0fab25
commit
fc46164556
14 changed files with 243 additions and 0 deletions
19
internal/app/routes.go
Normal file
19
internal/app/routes.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
"maot-shortner/internal/handlers"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type HandlerList struct {
|
||||
*handlers.LinkHandler
|
||||
}
|
||||
|
||||
func CreateMux(handlers HandlerList) *http.ServeMux {
|
||||
r := http.NewServeMux()
|
||||
|
||||
r.HandleFunc("/links", handlers.LinkHandler.ListLinks)
|
||||
r.HandleFunc("/", handlers.LinkHandler.Handle)
|
||||
|
||||
return r
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue