Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit 0072abe

Browse files
committed
Merge branch 'main' into toasted/analytics
1 parent 019497a commit 0072abe

17 files changed

Lines changed: 422 additions & 480 deletions

File tree

api/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"with-env": "dotenv -e ../.env --"
1212
},
1313
"dependencies": {
14-
"@hono/trpc-server": "^0.3.2",
1514
"@hono/zod-openapi": "^0.15.1",
16-
"@trpc/server": "^10.45.2",
15+
"@hono/zod-validator": "^0.2.2",
1716
"cron": "^3.1.7",
1817
"drizzle-orm": "^0.32.1",
19-
"hono": "^4.5.2",
18+
"hono": "^4.5.11",
2019
"postgres": "^3.4.4",
21-
"redis": "^4.7.0"
20+
"redis": "^4.7.0",
21+
"zod": "^3.23.8"
2222
},
2323
"devDependencies": {
2424
"@types/bun": "latest",

api/src/index.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { apiEnv } from "@countify/env/api";
2-
import { trpcServer } from "@hono/trpc-server";
31
import { Hono } from "hono";
4-
import { appRouter } from "./router";
5-
import { createContext } from "./utils/trpc";
6-
import { restRouter } from "./rest";
2+
import { guildsRouter } from "./router/guilds";
3+
import { channelsRouter } from "./router/channels";
74
import { createAnalyticsCronJob } from "./analytics";
85

96
const app = new Hono();
@@ -16,21 +13,8 @@ app.get("/", (c) => {
1613
});
1714
});
1815

19-
app.route("/", restRouter);
20-
21-
app.use(
22-
"/trpc/*",
23-
async (c, next) => {
24-
if (c.req.header("authorization") !== apiEnv.AUTH_TOKEN) {
25-
return c.json({ error: "Unauthorized" }, 401);
26-
}
27-
return next();
28-
},
29-
trpcServer({
30-
router: appRouter,
31-
createContext,
32-
})
33-
);
16+
const routes = app.route("/", guildsRouter).route("/", channelsRouter);
17+
export type AppType = typeof routes;
3418

3519
Bun.serve({
3620
fetch: app.fetch,

api/src/rest/index.ts

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)