···11-import { db } from "../libs/db";
22-import { takes as takesTable } from "../libs/schema";
11+import { db } from "../../../libs/db";
22+import { takes as takesTable } from "../../../libs/schema";
33import { eq, and } from "drizzle-orm";
4455-export async function getVideo(url: URL): Promise<Response> {
55+export default async function getVideo(url: URL): Promise<Response> {
66 const videoId = url.pathname.split("/")[2];
7788 if (!videoId) {
+4-4
src/index.ts
···55import { t } from "./libs/template";
66import { blog } from "./libs/Logger";
77import { version, name } from "../package.json";
88-import { getVideo } from "./features/video";
88+import { video } from "./features/api";
99const environment = process.env.NODE_ENV;
10101111import * as Sentry from "@sentry/bun";
···3636console.log(
3737 `----------------------------------\n${name} Server\n----------------------------------\n`,
3838);
3939-console.log(`๐๏ธ Starting ${name}...`);
3939+console.log(`๐๏ธ Starting ${name}...`);
4040console.log("๐ฆ Loading Slack App...");
4141console.log("๐ Loading environment variables...");
4242···5050});
5151const slackClient = slackApp.client;
52525353-console.log(`โ๏ธ Loading ${Object.entries(features).length} features...`);
5353+console.log(`โ๏ธ Loading ${Object.entries(features).length} features...`);
5454for (const [feature, handler] of Object.entries(features)) {
5555 console.log(`๐ฆ ${feature} loaded`);
5656 if (typeof handler === "function") {
···7272 case "/slack":
7373 return slackApp.run(request);
7474 case "/video":
7575- return getVideo(url);
7575+ return video(url);
7676 default:
7777 return new Response("404 Not Found", { status: 404 });
7878 }