refactor: move non-public routes to internal subfolder

"non-public" in this case means only used for event handling (and not supposed to be called by clients)
This commit is contained in:
2024-09-08 14:35:00 -05:00
parent ff5e81f5d1
commit d4a5a4fbb1
5 changed files with 16 additions and 10 deletions

View File

@@ -0,0 +1,14 @@
import { Hono } from "hono";
const app = new Hono();
app.route(
"/new-episode",
await import("./new-episode").then((controller) => controller.default),
);
app.route(
"/upcoming-titles",
await import("./upcoming-titles").then((controller) => controller.default),
);
export default app;

View File

@@ -43,8 +43,6 @@ app.post(
}
const domain = c.req.url.replace(c.req.path, "");
console.log(`${domain}/episodes/${aniListId}`);
const { success, result: fetchEpisodesResult } = await fetch(
`${domain}/episodes/${aniListId}`,
).then((res) => res.json<EpisodesResponseSchema>());

View File

@@ -34,14 +34,8 @@ app.route(
await import("~/controllers/token").then((controller) => controller.default),
);
app.route(
"/upcoming-titles",
await import("~/controllers/upcoming-titles").then(
(controller) => controller.default,
),
);
app.route(
"/new-episode",
await import("~/controllers/new-episode").then(
"/internal",
await import("~/controllers/internal").then(
(controller) => controller.default,
),
);