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:
14
src/controllers/internal/index.ts
Normal file
14
src/controllers/internal/index.ts
Normal 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;
|
||||
@@ -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>());
|
||||
10
src/index.ts
10
src/index.ts
@@ -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,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user