1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-10 22:41:25 +02:00

Imported github.com/ardanlabs/service as base example project

This commit is contained in:
Lee Brown
2019-05-16 10:39:25 -04:00
parent a5af03321d
commit e6453bae45
304 changed files with 51148 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package handlers
import (
"log"
"net/http"
"os"
"time"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/mid"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/web"
)
// API returns a handler for a set of routes.
func API(shutdown chan os.Signal, log *log.Logger, zipkinHost string, apiHost string) http.Handler {
app := web.NewApp(shutdown, log, mid.Logger(log), mid.Errors(log))
z := NewZipkin(zipkinHost, apiHost, time.Second)
app.Handle("POST", "/v1/publish", z.Publish)
h := Health{}
app.Handle("GET", "/v1/health", h.Check)
return app
}