feat: add server-info endpoint and include server information in info.json
This commit is contained in:
8
backend/info.json
Normal file
8
backend/info.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"backend-info": {
|
||||||
|
"version": "v2.0"
|
||||||
|
},
|
||||||
|
"frontend-info": {
|
||||||
|
"version": "v2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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}`);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user