goblin/internal/router/router.go

18 lines
282 B
Go
Raw Normal View History

2023-09-07 21:06:26 +03:00
package router
import (
"net/http"
"github.com/gorilla/mux"
"goblin/internal/paste"
)
func NewRouter() http.Handler {
r := mux.NewRouter()
2023-09-07 22:09:24 +03:00
2023-09-07 21:06:26 +03:00
r.HandleFunc("/", paste.CreatePasteHandler).Methods("POST")
r.HandleFunc("/{id}", paste.GetPasteHandler).Methods("GET")
2023-09-07 22:09:24 +03:00
2023-09-07 21:06:26 +03:00
return r
}