Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fetch } from "undici";

// CONSTANTS
const kDefaultPlatform = "github.com";
const kOpenSSFScorecardRestApi = "https://api.securityscorecards.dev";
export const API_URL = "https://api.securityscorecards.dev";

export type ScorecardCheck = {
name: string;
Expand Down Expand Up @@ -50,7 +50,7 @@ export async function result(
const { platform = kDefaultPlatform } = options;

const response = await fetch(
new URL(`/projects/${platform}/${repository}`, kOpenSSFScorecardRestApi)
new URL(`/projects/${platform}/${repository}`, API_URL)
);
if (!response.ok) {
throw new Error(response.statusText);
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function badge(
): Promise<BadgeResult> {
const { platform = kDefaultPlatform, style = "flat" } = options;

const apiUrl = new URL(`/projects/${platform}/${repository}/badge`, kOpenSSFScorecardRestApi);
const apiUrl = new URL(`/projects/${platform}/${repository}/badge`, API_URL);
apiUrl.searchParams.set("style", style);

const response = await fetch(apiUrl);
Expand Down