init commit
This commit is contained in:
12
handler/article.go
Normal file
12
handler/article.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo"
|
||||
)
|
||||
|
||||
// GetTest doesn't do anything
|
||||
func (h *Handler) GetTest(c echo.Context) error {
|
||||
return c.JSON(http.StatusOK, "hello")
|
||||
}
|
||||
13
handler/handler.go
Normal file
13
handler/handler.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/labstack/echo"
|
||||
)
|
||||
|
||||
// Handler is passed to the handler functions so
|
||||
// they can access the database
|
||||
type Handler struct {
|
||||
DB *gorm.DB
|
||||
Router *echo.Echo
|
||||
}
|
||||
Reference in New Issue
Block a user