feat: add server-info endpoint and include server information in info.json

This commit is contained in:
2025-10-26 21:55:59 +01:00
parent af513034ef
commit 83f1c9d191
2 changed files with 13 additions and 0 deletions

8
backend/info.json Normal file
View File

@@ -0,0 +1,8 @@
{
"backend-info": {
"version": "v2.0"
},
"frontend-info": {
"version": "v2.0"
}
}

View File

@@ -6,6 +6,7 @@ import apiRouterV2 from "./routes/apiV2.js";
env.config(); env.config();
const app = express(); const app = express();
const port = 8002; const port = 8002;
import serverInfo from "./info.json" assert { type: "json" }
app.use(cors()); app.use(cors());
// Increase body size limits to support large CSV JSON payloads // Increase body size limits to support large CSV JSON payloads
@@ -20,6 +21,10 @@ app.get("/", (req, res) => {
res.render("index.ejs"); res.render("index.ejs");
}); });
app.get("/server-info", async (req, res) => {
res.status(200).json(serverInfo);
});
app.listen(port, () => { app.listen(port, () => {
console.log(`Server is running on port: ${port}`); console.log(`Server is running on port: ${port}`);
}); });