Skip to content

Commit

Permalink
update echo to 3.2.1 (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyama86 authored and kotakanbe committed Aug 16, 2017
1 parent a0cf9c1 commit 2704107
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
22 changes: 14 additions & 8 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
[[constraint]]
name = "github.com/cheggaaa/pb"
branch = "master"

[[constraint]]
name = "cloud.google.com/go/storage"
branch = "master"
11 changes: 5 additions & 6 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import (
"github.com/kotakanbe/go-cve-dictionary/db"
log "github.com/kotakanbe/go-cve-dictionary/log"
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
"github.com/labstack/echo/middleware"
)

// Start starts CVE dictionary HTTP Server.
func Start(logDir string, driver db.DB) error {
e := echo.New()
e.SetDebug(config.Conf.Debug)
e.Debug = config.Conf.Debug

// Middleware
e.Use(middleware.Logger())
Expand All @@ -40,14 +39,14 @@ func Start(logDir string, driver db.DB) error {
}))

// Routes
e.Get("/health", health())
e.Get("/cves/:id", getCve(driver))
e.Post("/cpes", getCveByCpeName(driver))
e.GET("/health", health())
e.GET("/cves/:id", getCve(driver))
e.POST("/cpes", getCveByCpeName(driver))

bindURL := fmt.Sprintf("%s:%s", config.Conf.Bind, config.Conf.Port)
log.Infof("Listening on %s", bindURL)

e.Run(standard.New(bindURL))
e.Start(bindURL)
return nil
}

Expand Down

0 comments on commit 2704107

Please sign in to comment.