Skip to content

Commit

Permalink
Fix(api): Simplified URL and updated README (#8)
Browse files Browse the repository at this point in the history
Signed-off-by: Bengt Wegner <[email protected]>
  • Loading branch information
Petzys committed Sep 18, 2024
1 parent 1ca76d5 commit 33d5dbe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Available Commands:
dir Analyze cryptographic assets in a directory
help Help about any command
image Analyze cryptographic assets in a container image
server Start a server (port: 8080, see openapi.yaml)
Flags:
-b, --bom string BOM file to be verified and enriched
Expand Down Expand Up @@ -113,7 +114,10 @@ Server: Docker Engine - Community

```shell
docker build -t cbomkit-theia .
# CLI
docker run cbomkit-theia [command] > enriched_CBOM.json
# Server
docker run -d -p 8080:8080 cbomkit-theia
```

### Compiled
Expand Down
2 changes: 1 addition & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

var serverCmd = &cobra.Command{
Use: "server",
Short: "Start a server",
Short: "Start a server (port: 8080, see openapi.yaml)",
Run: func(cmd *cobra.Command, args []string) {
server.Serve()
},
Expand Down
6 changes: 3 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ info:
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 0.0.1
paths:
/api/v1/image/get:
/api/v1/image:
post:
summary: Generate CBOM from existing image
summary: Generate CBOM from a Container Image
requestBody:
required: true
content:
Expand All @@ -17,7 +17,7 @@ paths:
type: object
properties:
image:
description: Identifier for Image
description: Identifier for the Container Image
example: "nginx"
type: string
plugins:
Expand Down
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Serve() {
r.SetTrustedProxies(nil)
v1 := r.Group("/api/v1")
{
v1.POST("/image/get", imageGet)
v1.POST("/image", imageGet)
}
r.Run(":8080") // listen and serve on 0.0.0.0:8080
}
Expand Down

0 comments on commit 33d5dbe

Please sign in to comment.