adding connection now works

This commit is contained in:
Puyodead1
2023-03-18 19:15:40 -04:00
parent 21bfda32e4
commit 6a52e65e27
13 changed files with 54 additions and 41 deletions
+5
View File
@@ -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({