Skip to content

Commit

Permalink
feat(gogoanime): Add list all anime route (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
hase0278 authored Feb 25, 2024
1 parent abd1d9b commit eb39bb9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/routes/anime/gogoanime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const routes = async (fastify: FastifyInstance, options: RegisterOptions) => {
'/movies',
'/popular',
'/recent-episodes',
'/anime-list',
],
documentation: 'https://docs.consumet.org/#tag/gogoanime',
});
Expand Down Expand Up @@ -173,6 +174,22 @@ const routes = async (fastify: FastifyInstance, options: RegisterOptions) => {

const res = await gogoanime.fetchRecentEpisodes(page, type);

reply.status(200).send(res);
} catch (err) {
reply
.status(500)
.send({ message: 'Something went wrong. Contact developers for help.' });
}
},
);
fastify.get(
'/anime-list',
async (request: FastifyRequest, reply: FastifyReply) => {
try {
const page = (request.query as { page: number }).page;

const res = await gogoanime.fetchAnimeList(page);

reply.status(200).send(res);
} catch (err) {
reply
Expand Down

0 comments on commit eb39bb9

Please sign in to comment.