summary refs log tree commit diff
path: root/api
diff options
context:
space:
mode:
authorxnacly <matteogropp@protonmail.com>2021-09-03 21:33:44 +0200
committerxnacly <matteogropp@protonmail.com>2021-09-03 21:33:44 +0200
commit0f58995182e438e0655071c3f1b7ea66e31cb779 (patch)
treea5f7995a1c0f54ec3f079b3d21db1e00e1f9af7b /api
parentreplace '@me' with req.user_id in guild join (diff)
downloadserver-0f58995182e438e0655071c3f1b7ea66e31cb779.tar.xz
added big todo list to Guild.ts (big chungus)
Diffstat (limited to 'api')
-rw-r--r--api/src/middlewares/RateLimit.ts1
-rw-r--r--api/src/routes/discoverable-guilds.ts14
2 files changed, 15 insertions, 0 deletions
diff --git a/api/src/middlewares/RateLimit.ts b/api/src/middlewares/RateLimit.ts
index dffbc0d9..a15ccbe6 100644
--- a/api/src/middlewares/RateLimit.ts
+++ b/api/src/middlewares/RateLimit.ts
@@ -107,6 +107,7 @@ export default function rateLimit(opts: {
 }
 
 export async function initRateLimits(app: Router) {
+	return;
 	const { routes, global, ip, error } = Config.get().limits.rate;
 	await listenEvent(EventRateLimit, (event) => {
 		Cache.set(event.channel_id as string, event.data);
diff --git a/api/src/routes/discoverable-guilds.ts b/api/src/routes/discoverable-guilds.ts
new file mode 100644
index 00000000..6ff43cdc
--- /dev/null
+++ b/api/src/routes/discoverable-guilds.ts
@@ -0,0 +1,14 @@
+import { Guild } from "@fosscord/util";
+import { Router, Request, Response } from "express";
+import { In } from "typeorm";
+
+const router = Router();
+
+router.get("/", async (req: Request, res: Response) => {
+	const { limit } = req.params;
+
+	const guilds = await Guild.find({ where: { features: "PENIS" } }); //, take: Math.abs(Number(limit)) });
+	res.send({ guilds: guilds });
+});
+
+export default router;