Skip to content

Commit

Permalink
Potential fix for 619. Server.js is imported as a dynamic import
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Oct 7, 2023
1 parent 24753ee commit 48ad235
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ Arguments can be passed either via the query string or as a JSON body. The follo
| projectGroup | Dependency track project group |
| projectVersion | Dependency track project version [default: ""] |

### Health endpoint

Use the /health endpoint to check if the SBOM server is up and running.

```shell
curl "http://127.0.0.1:9090/health"
```

### Scanning a local path

```shell
Expand Down
4 changes: 2 additions & 2 deletions bin/cdxgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { tmpdir } from "node:os";
import { basename, dirname, join, resolve } from "node:path";
import jws from "jws";
import crypto from "node:crypto";
import { start as _serverStart } from "../server.js";
import { fileURLToPath } from "node:url";
import globalAgent from "global-agent";
import process from "node:process";
Expand Down Expand Up @@ -243,7 +242,8 @@ const checkPermissions = (filePath) => {
(async () => {
// Start SBOM server
if (args.server) {
return await _serverStart(options);
const serverModule = await import("../server.js");
return await serverModule.start(options);
}
// Check if cdxgen has the required permissions
if (!checkPermissions(filePath)) {
Expand Down

0 comments on commit 48ad235

Please sign in to comment.