Skip to content

feat: load pexels url from env var#87

Merged
Perry2004 merged 1 commit into
mainfrom
feat/load-pexels-url-from-env-var
Jun 24, 2026
Merged

feat: load pexels url from env var#87
Perry2004 merged 1 commit into
mainfrom
feat/load-pexels-url-from-env-var

Conversation

@Perry2004

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 24, 2026 02:12
@Perry2004 Perry2004 merged commit 5b97713 into main Jun 24, 2026
3 checks passed
@Perry2004 Perry2004 deleted the feat/load-pexels-url-from-env-var branch June 24, 2026 02:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces a hardcoded Pexels “featured uploads” URL with a value read from an environment variable, and reuses that same configuration in both the CLI script entrypoint and the Lambda handler.

Changes:

  • Added getPexelsFeaturedUploadsUrl() to read PEXELS_FEATURED_UPLOADS_URL from process.env.
  • Updated main() to use the env-provided URL instead of an inline constant.
  • Updated lambda-handler.ts to use the shared URL getter.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scripts/src/main.ts Introduces env-based Pexels URL getter and uses it in the CLI entrypoint; exports the getter.
scripts/src/lambda-handler.ts Switches Lambda to use the shared env-based Pexels URL getter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 26 to 29
try {
const pexelsUrl =
"https://www.pexels.com/@perry-z-1662054943/featured-uploads/";
const pexelsUrl = getPexelsFeaturedUploadsUrl();
console.log(`Fetching images from: ${pexelsUrl}`);
const imageLinks = await getImageLinksPlaywright(pexelsUrl);
Comment thread scripts/src/main.ts
Comment on lines +10 to +20
function getPexelsFeaturedUploadsUrl(): string {
const pexelsUrl = process.env[PEXELS_FEATURED_UPLOADS_URL_ENV]?.trim();

if (!pexelsUrl) {
throw new Error(
`${PEXELS_FEATURED_UPLOADS_URL_ENV} environment variable is required`,
);
}

return pexelsUrl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants