1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-15 00:15:15 +02:00
This commit is contained in:
Lee Brown
2019-07-11 14:46:05 -08:00
parent 8eb9f6d976
commit df86310a8b
7 changed files with 205 additions and 211 deletions

View File

@ -9,9 +9,9 @@ import (
saasSwagger "geeks-accelerator/oss/saas-starter-kit/example-project/internal/mid/saas-swagger"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/auth"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/web"
_ "geeks-accelerator/oss/saas-starter-kit/example-project/internal/signup"
"github.com/jmoiron/sqlx"
"gopkg.in/DataDog/dd-trace-go.v1/contrib/go-redis/redis"
_ "geeks-accelerator/oss/saas-starter-kit/example-project/internal/signup"
)
// API returns a handler for a set of routes.
@ -23,7 +23,7 @@ func API(shutdown chan os.Signal, log *log.Logger, masterDB *sqlx.DB, redis *red
// Register health check endpoint. This route is not authenticated.
check := Check{
MasterDB: masterDB,
Redis: redis,
Redis: redis,
}
app.Handle("GET", "/v1/health", check.Health)
app.Handle("GET", "/ping", check.Ping)

View File

@ -16,11 +16,10 @@ import (
"syscall"
"time"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/devops"
"golang.org/x/crypto/acme/autocert"
"geeks-accelerator/oss/saas-starter-kit/example-project/cmd/web-api/docs"
"geeks-accelerator/oss/saas-starter-kit/example-project/cmd/web-api/handlers"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/auth"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/devops"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/flag"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
@ -28,6 +27,7 @@ import (
"github.com/go-redis/redis"
"github.com/kelseyhightower/envconfig"
"github.com/lib/pq"
"golang.org/x/crypto/acme/autocert"
awstrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go/aws"
sqltrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/database/sql"
redistrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/go-redis/redis"
@ -320,7 +320,7 @@ func main() {
// ECS Task registration for services that don't use an AWS Elastic Load Balancer.
err = devops.EcsServiceTaskInit(log, awsSession)
if err != nil {
log.Fatalf("main : Ecs Service Task init : %v", err)
log.Fatalf("main : Ecs Service Task init : %v", err)
}
// =========================================================================
@ -368,7 +368,6 @@ func main() {
}()
}
// Start the HTTPS service listening for requests.
if cfg.HTTPS.Host != "" {
api := http.Server{
@ -379,7 +378,6 @@ func main() {
MaxHeaderBytes: 1 << 20,
}
// Note: use a sensible value for data directory
// this is where cached certificates are stored
dataDir := "."
@ -399,8 +397,6 @@ func main() {
}
api.TLSConfig = &tls.Config{GetCertificate: m.GetCertificate}
httpServers = append(httpServers, api)
go func() {
@ -423,7 +419,7 @@ func main() {
// Ensure the public IP address for the task is removed from Route53.
err = devops.EcsServiceTaskTaskShutdown(log, awsSession)
if err != nil {
log.Fatalf("main : Ecs Service Task shutdown : %v", err)
log.Fatalf("main : Ecs Service Task shutdown : %v", err)
}
// Create context for Shutdown call.