mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-13 12:15:12 +00:00
Add /_spacebar/api/version - resolves #1222
This commit is contained in:
+8
-1
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user