goblin/internal/router/router.go

16 lines
280 B
Go
Raw Normal View History

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