init
This commit is contained in:
parent
79a7534428
commit
c8e82d5d43
13 changed files with 921 additions and 0 deletions
15
internal/router/router.go
Normal file
15
internal/router/router.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
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
|
||||
}
|
Reference in a new issue