return html with version
Some checks are pending
ci / build (push) Waiting to run
ci / test (push) Waiting to run

This commit is contained in:
CJ_Clippy 2025-08-25 14:48:34 -08:00
parent 46a9041b97
commit 4a185304ae
2 changed files with 15 additions and 2 deletions

View File

@ -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<br>THIS IS rssapp ${packageJson.version}<br>OK<br>try <a href="/projektmelody">/projektmelody</a>`);
});
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" });
}

View File

@ -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"
}
}
}