This commit is contained in:
2026-05-10 21:29:30 +02:00
parent 6714493af9
commit cd6dc3fc8f
5 changed files with 190 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
const cors = require("cors");
const express = require("express");
const fs = require("fs");
const path = require("path");
const swaggerUi = require("swagger-ui-express");
const { config } = require("./config");
@@ -7,7 +8,14 @@ const { pingMongo } = require("./db/client");
const { router: apiRouter } = require("./routes/api");
const { openApiDocument } = require("./swagger/openapi");
const skillFilePath = path.join(__dirname, "..", ".ai", "SKILL.md");
const skillFilePaths = [
path.join(__dirname, "..", ".idea", "SKILL.md"),
path.join(__dirname, "..", ".ai", "SKILL.md"),
];
function getSkillFilePath() {
return skillFilePaths.find((filePath) => fs.existsSync(filePath));
}
function createApp() {
const app = express();
@@ -54,6 +62,12 @@ function createApp() {
});
app.get("/SKILL.md", (request, response) => {
const skillFilePath = getSkillFilePath();
if (!skillFilePath) {
response.status(404).json({ error: "SKILL.md not found" });
return;
}
response.type("text/markdown");
response.sendFile(skillFilePath);
});