-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
32 lines (26 loc) · 834 Bytes
/
main.go
File metadata and controls
32 lines (26 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"github.com/dockerpedia/api/db"
"github.com/dockerpedia/api/models"
"github.com/gin-gonic/gin"
_ "github.com/lib/pq"
)
func main() {
db.Init()
router := gin.Default()
v1 := router.Group("/api/v1/")
{
v1.GET("/repositories/", models.SearchRepository)
v1.GET("/repositories/:id/", models.FetchRepository)
v1.GET("/repositories/:id/images", models.FetchImagesRepository)
v1.GET("/images/:id", models.FetchImage)
v1.GET("/images/:id/vulnerabilities", models.FetchImagesVulns)
v1.GET("/vulnerability/:id", models.FetchVulnerability)
v1.GET("/images/:id/packages", models.FetchImagesPackages)
v1.GET("/viz", models.FetchImagesViz)
v1.GET("/users", models.SearchUser)
v1.POST("/viz", models.FetchImagesVizPost)
v1.POST("/viz2", models.FetchImagesVizPostv2)
}
router.Run(":8080")
}