Apify and Crawlee Official Forum

M
Mike
Offline, last seen 4 months ago
Joined August 30, 2024
Hey, everyone! 👋
Is it possible to create a folder named routes in my project and then construct export const router in index.ts file by adding all my handlers from different files?

Like this
Plain Text
// Many imports...

export const router = createPlaywrightRouter();

router.addDefaultHandler(defaultHandler);
router.addHandler('catalog-page', catalogHandler);
router.addHandler('review-page', reviewsHandler);


And if this is possible, what should be the type of the handler in a separate file?
5 comments
A
M
L