Skip to content

Commit

Permalink
fix: typo in worthwhile
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclimse committed Oct 7, 2024
1 parent d1ed067 commit dfad9d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions functions/node-terraform/function/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ const parser = new Parser({
headers: { "User-Agent": "Scaleway Serverless Examples" },
});
const SOURCE_FEED_URL = process.env.SOURCE_FEED_URL || "https://lobste.rs/rss";
const WORTHWILE_TOPICS = process.env.WORTHWILE_TOPICS ||
const WORTHWHILE_TOPICS = process.env.WORTHWHILE_TOPICS ||
"nixos, nix, serverless, terraform";

const feed = new RSS({
title: `Worthwhile items from ${SOURCE_FEED_URL}`,
description: `All about ${WORTHWILE_TOPICS}`,
description: `All about ${WORTHWHILE_TOPICS}`,
language: "en",
ttl: "60",
});

// This is a simple function that given an RSS feed,
// filters out the items that contain any of the topics in the WORTHWILE_TOPICS environment variable.
// filters out the items that contain any of the topics in the WORTHWHILE_TOPICS environment variable.
// It then exposes a RSS feed on its own, with the filtered items.
async function handler(event, _context, _cb) {
const userAgent = event.headers["User-Agent"];
const ip = event.headers["X-Forwarded-For"].split(",")[0];
console.log("Got request from %s with user agent %s", ip, userAgent);

const topics = WORTHWILE_TOPICS.split(",").map((t) => t.trim());
const topics = WORTHWHILE_TOPICS.split(",").map((t) => t.trim());

const sourceFeed = await parser.parseURL(SOURCE_FEED_URL);
console.log("Parsing feed: %s", feed.title);
Expand Down
2 changes: 1 addition & 1 deletion functions/node-terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ resource "scaleway_function" "main" {

environment_variables = {
"SOURCE_FEED_URL" = "https://lobste.rs/rss"
"WORTHWHILE_TOPICS" = "nixos, nix, serverless, terraform"
"WORTHWHILE_TOPICS" = "nixos, nix, serverless, terraform, gleam"
}

deploy = true
Expand Down

0 comments on commit dfad9d9

Please sign in to comment.