21 lines
347 B
Go
21 lines
347 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.dev-null.rocks/alexohneander/distributed-cache/api"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
func Start() {
|
|
e := echo.New()
|
|
|
|
// Routes
|
|
e.GET("/", func(c echo.Context) error {
|
|
return c.String(http.StatusOK, "Hello, World!")
|
|
})
|
|
e.GET("/api/v1/cache/:id", api.GetItem)
|
|
|
|
e.Logger.Fatal(e.Start(":8080"))
|
|
}
|