1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 12:42:44 +01:00

Merge pull request #767 from MaddyUnderStars/feat/pingInformation

Expose general instance information via api /ping route
This commit is contained in:
Samuel 2022-06-15 12:10:03 +02:00 committed by GitHub
commit 2363620faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,26 @@
import { Router, Response, Request } from "express";
import { route } from "@fosscord/api";
import { Config } from "@fosscord/util";
const router = Router();
router.get("/", route({}), (req: Request, res: Response) => {
res.send("pong");
const { general } = Config.get();
res.send({
ping: "pong!",
instance: {
id: general.instanceId,
name: general.instanceName,
description: general.instanceDescription,
image: general.image,
correspondenceEmail: general.correspondenceEmail,
correspondenceUserID: general.correspondenceUserID,
frontPage: general.frontPage,
tosPage: general.tosPage,
},
});
});
export default router;