1
0
Fork 0

Revert mistakes

master
Ambrose Chua 2019-01-09 14:39:44 +08:00
parent a875b40362
commit 5b8692a930
3 changed files with 7 additions and 8 deletions

6
go.mod
View File

@ -1,6 +1,6 @@
module "github.com/serverwentdown/short"
module github.com/serverwentdown/short
require (
"github.com/julienschmidt/httprouter" v0.0.0-20150626000000-d18983907793
"github.com/lib/pq" v0.0.0-20180201184707-d34b9ff171c2
github.com/julienschmidt/httprouter v0.0.0-20150626000000-d18983907793
github.com/lib/pq v0.0.0-20180201184707-d34b9ff171c2
)

4
go.sum Normal file
View File

@ -0,0 +1,4 @@
github.com/julienschmidt/httprouter v0.0.0-20150626000000-d18983907793 h1:od+0FIrhmVJFv+bwjkVPTrBcc8ilKfvI8wwba4joboI=
github.com/julienschmidt/httprouter v0.0.0-20150626000000-d18983907793/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/lib/pq v0.0.0-20180201184707-d34b9ff171c2 h1:YWMQvnYCw3tNx1QOWBaz8P6A/0K7rfRhZXgUhJigmaE=
github.com/lib/pq v0.0.0-20180201184707-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=

View File

@ -1,16 +1,11 @@
package main
import (
"net/http"
"github.com/julienschmidt/httprouter"
)
func NewRouter(h *Handlers) *httprouter.Router {
router := httprouter.New()
router.GET("/healthz", func(w http.ResponseWriter, _ *http.Request, _ httprouter.Params) {
healthz(w)
})
router.POST("/new", h.Create)
router.GET("/", h.Index)
router.GET("/:id", h.Get)