mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-25 17:59:52 +00:00
adding connection now works
This commit is contained in:
@@ -25,6 +25,8 @@ import {
|
||||
registerRoutes,
|
||||
Sentry,
|
||||
WebAuthn,
|
||||
ConnectionConfig,
|
||||
ConnectionLoader
|
||||
} from "@fosscord/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { Server, ServerOptions } from "lambert-server";
|
||||
@@ -64,6 +66,7 @@ export class FosscordServer extends Server {
|
||||
await Config.init();
|
||||
await initEvent();
|
||||
await Email.init();
|
||||
await ConnectionConfig.init();
|
||||
await initInstance();
|
||||
await Sentry.init(this.app);
|
||||
WebAuthn.init();
|
||||
@@ -130,6 +133,8 @@ export class FosscordServer extends Server {
|
||||
|
||||
Sentry.errorHandler(this.app);
|
||||
|
||||
ConnectionLoader.loadConnections();
|
||||
|
||||
if (logRequests)
|
||||
console.log(
|
||||
red(
|
||||
|
||||
@@ -6,7 +6,7 @@ import { route } from "../../../util";
|
||||
const router = Router();
|
||||
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
const { connection_id: connection_name } = req.params;
|
||||
const { connection_name } = req.params;
|
||||
const connection = ConnectionStore.connections.get(connection_name);
|
||||
if (!connection)
|
||||
throw FieldErrors({
|
||||
|
||||
@@ -13,7 +13,7 @@ router.post(
|
||||
"/",
|
||||
route({ body: "ConnectionCallbackSchema" }),
|
||||
async (req: Request, res: Response) => {
|
||||
const { connection_id: connection_name } = req.params;
|
||||
const { connection_name } = req.params;
|
||||
const connection = ConnectionStore.connections.get(connection_name);
|
||||
if (!connection)
|
||||
throw FieldErrors({
|
||||
|
||||
Reference in New Issue
Block a user