@crawlee/httpFunctionscreateFileRouterVersion: NextcreateFileRouter CallablecreateFileRouter(routes?: RouterRoutes<Context, UserData>): RouterHandler<Context>Creates new Router instance that works based on request labels. This instance can then serve as a requestHandler of your FileDownload. Defaults to the FileDownloadCrawlingContext. Serves as a shortcut for using Router.create<FileDownloadCrawlingContext>().import { FileDownload, createFileRouter } from 'crawlee';const router = createFileRouter();router.addHandler('label-a', async (ctx) => { ctx.log.info('...');});router.addDefaultHandler(async (ctx) => { ctx.log.info('...');});const crawler = new FileDownload({ requestHandler: router,});await crawler.run();Parametersoptionalroutes: RouterRoutes<Context, UserData>Returns RouterHandler<Context>
Creates new Router instance that works based on request labels. This instance can then serve as a
requestHandler
of your FileDownload. Defaults to the FileDownloadCrawlingContext.