From 4a185304ae6b32f7de3e55f2e7bd480f8ab40cdd Mon Sep 17 00:00:00 2001 From: CJ_Clippy Date: Mon, 25 Aug 2025 14:48:34 -0800 Subject: [PATCH] return html with version --- services/rssapp/index.js | 13 +++++++++++++ services/rssapp/package.json | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/services/rssapp/index.js b/services/rssapp/index.js index 77ebb91..f6b3a88 100644 --- a/services/rssapp/index.js +++ b/services/rssapp/index.js @@ -7,6 +7,7 @@ import TTLCache from '@isaacs/ttlcache'; import '@dotenvx/dotenvx/config.js'; import { ApifyClient } from 'apify-client'; import { env } from './env.js'; +import packageJson from "./package.json" with { type: "json" }; const fastify = Fastify({ logger: true }); @@ -74,10 +75,22 @@ function buildFeed(username, tweets) { return feed.xml({ indent: true }); } +fastify.get("/", (request, reply) => { + return reply + .code(200) + .header("Content-Type", "text/html; charset=utf-8") + .send(`HELLO
THIS IS rssapp ${packageJson.version}
OK
try /projektmelody`); +}); + + fastify.get("/:username", async (request, reply) => { const { username } = request.params; const key = username.toLowerCase(); + if (!key) { + return reply.code(401).send({ error: "Username missing" }); + } + if (!env.WHITELIST.has(key)) { return reply.code(403).send({ error: "Forbidden username" }); } diff --git a/services/rssapp/package.json b/services/rssapp/package.json index 3864bcb..4853b07 100644 --- a/services/rssapp/package.json +++ b/services/rssapp/package.json @@ -1,6 +1,6 @@ { "name": "rssapp", - "version": "69.0.0", + "version": "69.0.1", "description": "", "main": "index.js", "type": "module", @@ -19,4 +19,4 @@ "rss": "^1.2.2", "zod": "^4.1.1" } -} +} \ No newline at end of file