mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-25 12:04:39 +00:00
Move endpoints to respective versions, split out non implemented routes
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
This commit is contained in:
+1
-5
@@ -88,11 +88,7 @@ export class FosscordServer extends Server {
|
||||
|
||||
//app.use("/__development", )
|
||||
//app.use("/__internals", )
|
||||
app.use("/api/v6", api);
|
||||
app.use("/api/v7", api);
|
||||
app.use("/api/v8", api);
|
||||
app.use("/api/v9", api);
|
||||
app.use("/api", api); // allow unversioned requests
|
||||
app.use("/api", api); //versioning happens based on route folder name
|
||||
|
||||
this.app.use(ErrorHandler);
|
||||
TestClient(this.app);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Router, Response, Request } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
import {
|
||||
Channel,
|
||||
Config,
|
||||
handleFile,
|
||||
trimSpecial,
|
||||
User,
|
||||
Webhook,
|
||||
WebhookCreateSchema,
|
||||
WebhookType,
|
||||
} from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { isTextChannel } from "./messages/index";
|
||||
import { DiscordApiErrors } from "@fosscord/util";
|
||||
import crypto from "crypto";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
//TODO: implement webhooks
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
res.json([]);
|
||||
});
|
||||
|
||||
export default router;
|
||||
+1
-1
@@ -11,7 +11,7 @@ import {
|
||||
Guild,
|
||||
PublicInviteRelation,
|
||||
} from "@fosscord/util";
|
||||
import { isTextChannel } from "./messages";
|
||||
import { isTextChannel } from "../../../v0/channels/#channel_id/messages";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { route } from "@fosscord/api";
|
||||
import { isTextChannel } from "./messages";
|
||||
import { isTextChannel } from "../../../v0/channels/#channel_id/messages";
|
||||
import { FindManyOptions, Between, Not } from "typeorm";
|
||||
import {
|
||||
Channel,
|
||||
+1
-6
@@ -11,17 +11,12 @@ import {
|
||||
WebhookType,
|
||||
} from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { isTextChannel } from "./messages/index";
|
||||
import { isTextChannel } from "../../../v0/channels/#channel_id/messages/index";
|
||||
import { DiscordApiErrors } from "@fosscord/util";
|
||||
import crypto from "crypto";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
//TODO: implement webhooks
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
res.json([]);
|
||||
});
|
||||
|
||||
// TODO: use Image Data Type for avatar instead of String
|
||||
router.post(
|
||||
"/",
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user