summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-02-25 10:49:05 +0100
committerRory& <root@rory.gay>2026-02-25 10:49:05 +0100
commit0a1e4e9d6b9da8086521534d0dca25f83fc8a5f3 (patch)
tree44f1bc3415e144baabb24987e1a65fe5283eaf6e /src/api
parentdisable toJSON for read states? (diff)
downloadserver-ts-0a1e4e9d6b9da8086521534d0dca25f83fc8a5f3.tar.xz
Add /_spacebar/api/version - resolves #1222
Diffstat (limited to 'src/api')
-rw-r--r--src/api/Server.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/api/Server.ts b/src/api/Server.ts

index a6bb5178d..6a61d3cba 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts
@@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Config, ConnectionConfig, ConnectionLoader, Email, JSONReplacer, WebAuthn, initDatabase, initEvent, registerRoutes, getDatabase } from "@spacebar/util"; +import { Config, ConnectionConfig, ConnectionLoader, Email, JSONReplacer, WebAuthn, initDatabase, initEvent, registerRoutes, getDatabase, getRevInfoOrFail } from "@spacebar/util"; import { Authentication, CORS, ImageProxy, BodyParser, ErrorHandler, initRateLimits, initTranslation } from "./middlewares"; import { Request, Response, Router } from "express"; import { Server, ServerOptions } from "lambert-server"; @@ -141,6 +141,13 @@ export class SpacebarServer extends Server { res.sendFile(path.join(ASSETS_FOLDER, "openapi.json")); }); + app.get("/_spacebar/api/version", (req, res) => { + res.json({ + implementation: "spacebar-server-ts", + version: getRevInfoOrFail(), + }); + }); + // current well-known location app.get("/.well-known/spacebar", (req, res) => { res.json({