import { FastifyInstance } from 'fastify';
import * as controller from './books.controller';

async function booksRoutes(fastify: FastifyInstance) {
    fastify.get('/book/:id', controller.getBook);
    fastify.get('/books/trending', controller.getTrending);
    fastify.get('/books/popular', controller.getPopular);
    fastify.get('/search/books', controller.searchBooks);
    fastify.get('/search/books/:extension', controller.searchBooksInExtension);
    fastify.get('/book/:id/chapters', controller.getChapters);
    fastify.get('/book/:bookId/:chapter/:provider', controller.getChapterContent);
}

export default booksRoutes;